summaryrefslogtreecommitdiff
path: root/vendor/symfony/polyfill-php72
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-03-01 19:32:52 -0600
committerChristian Cleberg <[email protected]>2026-03-01 19:32:52 -0600
commita98c2a4542e19ce4fb632bc32fc47c18273161cc (patch)
tree99d016c1c9f12d98d57cfec34262e7c228a1d920 /vendor/symfony/polyfill-php72
parentcd8c38db601355003510e92a0936cde6b71cf849 (diff)
downloadmichelangelo-a98c2a4542e19ce4fb632bc32fc47c18273161cc.tar.gz
michelangelo-a98c2a4542e19ce4fb632bc32fc47c18273161cc.tar.bz2
michelangelo-a98c2a4542e19ce4fb632bc32fc47c18273161cc.zip
convert from PHP to Go
Diffstat (limited to 'vendor/symfony/polyfill-php72')
-rw-r--r--vendor/symfony/polyfill-php72/LICENSE19
-rw-r--r--vendor/symfony/polyfill-php72/Php72.php217
-rw-r--r--vendor/symfony/polyfill-php72/README.md28
-rw-r--r--vendor/symfony/polyfill-php72/bootstrap.php57
-rw-r--r--vendor/symfony/polyfill-php72/composer.json35
5 files changed, 0 insertions, 356 deletions
diff --git a/vendor/symfony/polyfill-php72/LICENSE b/vendor/symfony/polyfill-php72/LICENSE
deleted file mode 100644
index 4cd8bdd..0000000
--- a/vendor/symfony/polyfill-php72/LICENSE
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (c) 2015-2019 Fabien Potencier
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is furnished
-to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/vendor/symfony/polyfill-php72/Php72.php b/vendor/symfony/polyfill-php72/Php72.php
deleted file mode 100644
index 9b3edc7..0000000
--- a/vendor/symfony/polyfill-php72/Php72.php
+++ /dev/null
@@ -1,217 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <[email protected]>
- *
- * 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 <[email protected]>
- * @author Dariusz RumiƄski <[email protected]>
- *
- * @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 = array(
- 'Darwin' => 'Darwin',
- 'DragonFly' => 'BSD',
- 'FreeBSD' => 'BSD',
- 'NetBSD' => 'BSD',
- 'OpenBSD' => 'BSD',
- 'Linux' => 'Linux',
- 'SunOS' => 'Solaris',
- );
-
- return isset($map[PHP_OS]) ? $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) array();
- self::$hashMask = -1;
-
- // check if we are nested in an output buffering handler to prevent a fatal error with ob_start() below
- $obFuncs = array('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) {
- $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 59dec8a..0000000
--- a/vendor/symfony/polyfill-php72/README.md
+++ /dev/null
@@ -1,28 +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)
-
-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/master/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 a27a900..0000000
--- a/vendor/symfony/polyfill-php72/bootstrap.php
+++ /dev/null
@@ -1,57 +0,0 @@
-<?php
-
-/*
- * This file is part of the Symfony package.
- *
- * (c) Fabien Potencier <[email protected]>
- *
- * 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($s) { return p\Php72::utf8_encode($s); }
-}
-if (!function_exists('utf8_decode')) {
- function utf8_decode($s) { return p\Php72::utf8_decode($s); }
-}
-if (!function_exists('spl_object_id')) {
- function spl_object_id($s) { return p\Php72::spl_object_id($s); }
-}
-if (!function_exists('mb_ord')) {
- function mb_ord($s, $enc = null) { return p\Php72::mb_ord($s, $enc); }
-}
-if (!function_exists('mb_chr')) {
- function mb_chr($code, $enc = null) { return p\Php72::mb_chr($code, $enc); }
-}
-if (!function_exists('mb_scrub')) {
- function mb_scrub($s, $enc = null) { $enc = null === $enc ? mb_internal_encoding() : $enc; return mb_convert_encoding($s, $enc, $enc); }
-}
diff --git a/vendor/symfony/polyfill-php72/composer.json b/vendor/symfony/polyfill-php72/composer.json
deleted file mode 100644
index e295cab..0000000
--- 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": "[email protected]"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "require": {
- "php": ">=5.3.3"
- },
- "autoload": {
- "psr-4": { "Symfony\\Polyfill\\Php72\\": "" },
- "files": [ "bootstrap.php" ]
- },
- "minimum-stability": "dev",
- "extra": {
- "branch-alias": {
- "dev-master": "1.18-dev"
- },
- "thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
- }
- }
-}