diff options
Diffstat (limited to 'assets/php/vendor/symfony/polyfill-php70')
12 files changed, 234 insertions, 0 deletions
diff --git a/assets/php/vendor/symfony/polyfill-php70/LICENSE b/assets/php/vendor/symfony/polyfill-php70/LICENSE new file mode 100644 index 0000000..24fa32c --- /dev/null +++ b/assets/php/vendor/symfony/polyfill-php70/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2015-2018 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/assets/php/vendor/symfony/polyfill-php70/Php70.php b/assets/php/vendor/symfony/polyfill-php70/Php70.php new file mode 100644 index 0000000..8e78450 --- /dev/null +++ b/assets/php/vendor/symfony/polyfill-php70/Php70.php @@ -0,0 +1,74 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Php70; + +/** + * @author Nicolas Grekas <p@tchwork.com> + * + * @internal + */ +final class Php70 +{ + public static function intdiv($dividend, $divisor) + { + $dividend = self::intArg($dividend, __FUNCTION__, 1); + $divisor = self::intArg($divisor, __FUNCTION__, 2); + + if (0 === $divisor) { + throw new \DivisionByZeroError('Division by zero'); + } + if (-1 === $divisor && ~PHP_INT_MAX === $dividend) { + throw new \ArithmeticError('Division of PHP_INT_MIN by -1 is not an integer'); + } + + return ($dividend - ($dividend % $divisor)) / $divisor; + } + + public static function preg_replace_callback_array(array $patterns, $subject, $limit = -1, &$count = 0) + { + $count = 0; + $result = (string) $subject; + if (0 === $limit = self::intArg($limit, __FUNCTION__, 3)) { + return $result; + } + + foreach ($patterns as $pattern => $callback) { + $result = preg_replace_callback($pattern, $callback, $result, $limit, $c); + $count += $c; + } + + return $result; + } + + public static function error_clear_last() + { + static $handler; + if (!$handler) { + $handler = function() { return false; }; + } + set_error_handler($handler); + @trigger_error(''); + restore_error_handler(); + } + + public static function intArg($value, $caller, $pos) + { + if (is_int($value)) { + return $value; + } + if (!is_numeric($value) || PHP_INT_MAX <= ($value += 0) || ~PHP_INT_MAX >= $value) { + throw new \TypeError(sprintf('%s() expects parameter %d to be integer, %s given', $caller, $pos, gettype($value))); + } + + return (int) $value; + } +} diff --git a/assets/php/vendor/symfony/polyfill-php70/README.md b/assets/php/vendor/symfony/polyfill-php70/README.md new file mode 100644 index 0000000..04988c6 --- /dev/null +++ b/assets/php/vendor/symfony/polyfill-php70/README.md @@ -0,0 +1,28 @@ +Symfony Polyfill / Php70 +======================== + +This component provides features unavailable in releases prior to PHP 7.0: + +- [`intdiv`](http://php.net/intdiv) +- [`preg_replace_callback_array`](http://php.net/preg_replace_callback_array) +- [`error_clear_last`](http://php.net/error_clear_last) +- `random_bytes` and `random_int` (from [paragonie/random_compat](https://github.com/paragonie/random_compat)) +- [`*Error` throwable classes](http://php.net/Error) +- [`PHP_INT_MIN`](http://php.net/manual/en/reserved.constants.php#constant.php-int-min) +- `SessionUpdateTimestampHandlerInterface` + +More information can be found in the +[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). + +Compatibility notes +=================== + +To write portable code between PHP5 and PHP7, some care must be taken: +- `\*Error` exceptions must be caught before `\Exception`; +- after calling `error_clear_last()`, the result of `$e = error_get_last()` must be + verified using `isset($e['message'][0])` instead of `null !== $e`. + +License +======= + +This library is released under the [MIT license](LICENSE). diff --git a/assets/php/vendor/symfony/polyfill-php70/Resources/stubs/ArithmeticError.php b/assets/php/vendor/symfony/polyfill-php70/Resources/stubs/ArithmeticError.php new file mode 100644 index 0000000..6819124 --- /dev/null +++ b/assets/php/vendor/symfony/polyfill-php70/Resources/stubs/ArithmeticError.php @@ -0,0 +1,5 @@ +<?php + +class ArithmeticError extends Error +{ +} diff --git a/assets/php/vendor/symfony/polyfill-php70/Resources/stubs/AssertionError.php b/assets/php/vendor/symfony/polyfill-php70/Resources/stubs/AssertionError.php new file mode 100644 index 0000000..acb1250 --- /dev/null +++ b/assets/php/vendor/symfony/polyfill-php70/Resources/stubs/AssertionError.php @@ -0,0 +1,5 @@ +<?php + +class AssertionError extends Error +{ +} diff --git a/assets/php/vendor/symfony/polyfill-php70/Resources/stubs/DivisionByZeroError.php b/assets/php/vendor/symfony/polyfill-php70/Resources/stubs/DivisionByZeroError.php new file mode 100644 index 0000000..c99278b --- /dev/null +++ b/assets/php/vendor/symfony/polyfill-php70/Resources/stubs/DivisionByZeroError.php @@ -0,0 +1,5 @@ +<?php + +class DivisionByZeroError extends Error +{ +} diff --git a/assets/php/vendor/symfony/polyfill-php70/Resources/stubs/Error.php b/assets/php/vendor/symfony/polyfill-php70/Resources/stubs/Error.php new file mode 100644 index 0000000..405847f --- /dev/null +++ b/assets/php/vendor/symfony/polyfill-php70/Resources/stubs/Error.php @@ -0,0 +1,5 @@ +<?php + +class Error extends Exception +{ +} diff --git a/assets/php/vendor/symfony/polyfill-php70/Resources/stubs/ParseError.php b/assets/php/vendor/symfony/polyfill-php70/Resources/stubs/ParseError.php new file mode 100644 index 0000000..2dd447d --- /dev/null +++ b/assets/php/vendor/symfony/polyfill-php70/Resources/stubs/ParseError.php @@ -0,0 +1,5 @@ +<?php + +class ParseError extends Error +{ +} diff --git a/assets/php/vendor/symfony/polyfill-php70/Resources/stubs/SessionUpdateTimestampHandlerInterface.php b/assets/php/vendor/symfony/polyfill-php70/Resources/stubs/SessionUpdateTimestampHandlerInterface.php new file mode 100644 index 0000000..0cc02c8 --- /dev/null +++ b/assets/php/vendor/symfony/polyfill-php70/Resources/stubs/SessionUpdateTimestampHandlerInterface.php @@ -0,0 +1,23 @@ +<?php + +interface SessionUpdateTimestampHandlerInterface +{ + /** + * Checks if a session identifier already exists or not. + * + * @param string $key + * + * @return bool + */ + public function validateId($key); + + /** + * Updates the timestamp of a session when its data didn't change. + * + * @param string $key + * @param string $val + * + * @return bool + */ + public function updateTimestamp($key, $val); +} diff --git a/assets/php/vendor/symfony/polyfill-php70/Resources/stubs/TypeError.php b/assets/php/vendor/symfony/polyfill-php70/Resources/stubs/TypeError.php new file mode 100644 index 0000000..2bed1b4 --- /dev/null +++ b/assets/php/vendor/symfony/polyfill-php70/Resources/stubs/TypeError.php @@ -0,0 +1,5 @@ +<?php + +class TypeError extends Error +{ +} diff --git a/assets/php/vendor/symfony/polyfill-php70/bootstrap.php b/assets/php/vendor/symfony/polyfill-php70/bootstrap.php new file mode 100644 index 0000000..445c398 --- /dev/null +++ b/assets/php/vendor/symfony/polyfill-php70/bootstrap.php @@ -0,0 +1,27 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Php70 as p; + +if (PHP_VERSION_ID < 70000) { + if (!defined('PHP_INT_MIN')) { + define('PHP_INT_MIN', ~PHP_INT_MAX); + } + if (!function_exists('intdiv')) { + function intdiv($dividend, $divisor) { return p\Php70::intdiv($dividend, $divisor); } + } + if (!function_exists('preg_replace_callback_array')) { + function preg_replace_callback_array(array $patterns, $subject, $limit = -1, &$count = 0) { return p\Php70::preg_replace_callback_array($patterns, $subject, $limit, $count); } + } + if (!function_exists('error_clear_last')) { + function error_clear_last() { return p\Php70::error_clear_last(); } + } +} diff --git a/assets/php/vendor/symfony/polyfill-php70/composer.json b/assets/php/vendor/symfony/polyfill-php70/composer.json new file mode 100644 index 0000000..88ff357 --- /dev/null +++ b/assets/php/vendor/symfony/polyfill-php70/composer.json @@ -0,0 +1,33 @@ +{ + "name": "symfony/polyfill-php70", + "type": "library", + "description": "Symfony polyfill backporting some PHP 7.0+ 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": ">=5.3.3", + "paragonie/random_compat": "~1.0|~2.0" + }, + "autoload": { + "psr-4": { "Symfony\\Polyfill\\Php70\\": "" }, + "files": [ "bootstrap.php" ], + "classmap": [ "Resources/stubs" ] + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-master": "1.7-dev" + } + } +} |