Update to laravel 7

This commit is contained in:
KodeStar
2022-03-10 11:54:29 +00:00
parent 61a5a1a8b0
commit f9a19fce91
7170 changed files with 274189 additions and 283773 deletions

View File

@@ -36,14 +36,14 @@ namespace Symfony\Polyfill\Iconv;
*/
final class Iconv
{
const ERROR_ILLEGAL_CHARACTER = 'iconv(): Detected an illegal character in input string';
const ERROR_WRONG_CHARSET = 'iconv(): Wrong charset, conversion from `%s\' to `%s\' is not allowed';
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 = array(
private static $alias = [
'utf8' => 'utf-8',
'ascii' => 'us-ascii',
'tis-620' => 'iso-8859-11',
@@ -116,13 +116,13 @@ final class Iconv
'iso885914' => 'iso-8859-14',
'iso885915' => 'iso-8859-15',
'iso885916' => 'iso-8859-16',
);
private static $translitMap = array();
private static $convertMap = array();
];
private static $translitMap = [];
private static $convertMap = [];
private static $errorHandler;
private static $lastError;
private static $ulenMask = array("\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4);
private static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4];
private static $isValidUtf8;
public static function iconv($inCharset, $outCharset, $str)
@@ -238,7 +238,7 @@ final class Iconv
}
$str = explode("\n\n", $str, 2);
$headers = array();
$headers = [];
$str = preg_split('/\n(?![ \t])/', $str[0]);
foreach ($str as $str) {
@@ -251,7 +251,7 @@ final class Iconv
if (2 === \count($str)) {
if (isset($headers[$str[0]])) {
if (!\is_array($headers[$str[0]])) {
$headers[$str[0]] = array($headers[$str[0]]);
$headers[$str[0]] = [$headers[$str[0]]];
}
$headers[$str[0]][] = ltrim($str[1]);
} else {
@@ -268,7 +268,7 @@ final class Iconv
if (null === $charset) {
$charset = self::$internalEncoding;
}
if (ICONV_MIME_DECODE_CONTINUE_ON_ERROR & $mode) {
if (\ICONV_MIME_DECODE_CONTINUE_ON_ERROR & $mode) {
$charset .= '//IGNORE';
}
@@ -277,7 +277,7 @@ final class Iconv
}
$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);
$str = preg_split('/=\?([^?]+)\?([bqBQ])\?(.*?)\?=/', $str, -1, \PREG_SPLIT_DELIM_CAPTURE);
$result = self::iconv('utf-8', $charset, $str[0]);
if (false === $result) {
@@ -289,7 +289,7 @@ final class Iconv
while ($i < $len) {
$c = strtolower($str[$i]);
if ((ICONV_MIME_DECODE_CONTINUE_ON_ERROR & $mode)
if ((\ICONV_MIME_DECODE_CONTINUE_ON_ERROR & $mode)
&& 'utf-8' !== $c
&& !isset(self::$alias[$c])
&& !self::loadMap('from.', $c, $d)) {
@@ -312,7 +312,7 @@ final class Iconv
if ('' !== trim($d)) {
$result .= $d;
}
} elseif (ICONV_MIME_DECODE_CONTINUE_ON_ERROR & $mode) {
} elseif (\ICONV_MIME_DECODE_CONTINUE_ON_ERROR & $mode) {
$result .= "=?{$str[$i]}?{$str[$i + 1]}?{$str[$i + 2]}?={$str[$i + 3]}";
} else {
$result = false;
@@ -333,11 +333,11 @@ final class Iconv
case 'internal_encoding': return self::$internalEncoding;
}
return array(
return [
'input_encoding' => self::$inputEncoding,
'output_encoding' => self::$outputEncoding,
'internal_encoding' => self::$internalEncoding,
);
];
}
public static function iconv_set_encoding($type, $charset)
@@ -346,7 +346,6 @@ final class Iconv
case 'input_encoding': self::$inputEncoding = $charset; break;
case 'output_encoding': self::$outputEncoding = $charset; break;
case 'internal_encoding': self::$internalEncoding = $charset; break;
default: return false;
}
@@ -356,16 +355,16 @@ final class Iconv
public static function iconv_mime_encode($fieldName, $fieldValue, $pref = null)
{
if (!\is_array($pref)) {
$pref = array();
$pref = [];
}
$pref += array(
$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 = '';
@@ -381,7 +380,7 @@ final class Iconv
preg_match_all('/./us', $fieldValue, $chars);
$chars = isset($chars[0]) ? $chars[0] : array();
$chars = $chars[0] ?? [];
$lineBreak = (int) $pref['line-length'];
$lineStart = "=?{$pref['output-charset']}?{$scheme}?";
@@ -389,7 +388,7 @@ final class Iconv
$lineOffset = \strlen($lineStart) + 3;
$lineData = '';
$fieldValue = array();
$fieldValue = [];
$Q = 'Q' === $scheme;
@@ -401,7 +400,7 @@ final class Iconv
$o = $Q
? $c = preg_replace_callback(
'/[=_\?\x00-\x1F\x80-\xFF]/',
array(__CLASS__, 'qpByteCallback'),
[__CLASS__, 'qpByteCallback'],
$c
)
: base64_encode($lineData.$c);
@@ -472,7 +471,7 @@ final class Iconv
while ($i < $len) {
$u = $s[$i] & "\xF0";
$i += isset($ulenMask[$u]) ? $ulenMask[$u] : 1;
$i += $ulenMask[$u] ?? 1;
++$j;
}
@@ -541,10 +540,14 @@ final class Iconv
$start += $slen;
}
if (0 > $start) {
return false;
if (\PHP_VERSION_ID < 80000) {
return false;
}
$start = 0;
}
if ($start >= $slen) {
return false;
return \PHP_VERSION_ID >= 80000 ? '' : false;
}
$rx = $slen - $start;
@@ -556,7 +559,7 @@ final class Iconv
return '';
}
if (0 > $length) {
return false;
return \PHP_VERSION_ID >= 80000 ? '' : false;
}
if ($length > $rx) {
@@ -607,7 +610,7 @@ final class Iconv
$u[$j++] = $str[$i++];
} else {
$ulen = $str[$i] & "\xF0";
$ulen = isset($ulenMask[$ulen]) ? $ulenMask[$ulen] : 1;
$ulen = $ulenMask[$ulen] ?? 1;
$uchr = substr($str, $i, $ulen);
if (1 === $ulen || !($valid || preg_match('/^.$/us', $uchr))) {
@@ -619,10 +622,10 @@ final class Iconv
trigger_error(self::ERROR_ILLEGAL_CHARACTER);
return false;
} else {
$i += $ulen;
}
$i += $ulen;
$u[$j++] = $uchr[0];
isset($uchr[1]) && 0 !== ($u[$j++] = $uchr[1])
@@ -669,15 +672,15 @@ final class Iconv
$uchr = $str[$i++];
} else {
$ulen = $str[$i] & "\xF0";
$ulen = isset($ulenMask[$ulen]) ? $ulenMask[$ulen] : 1;
$ulen = $ulenMask[$ulen] ?? 1;
$uchr = substr($str, $i, $ulen);
if ($ignore && (1 === $ulen || !($valid || preg_match('/^.$/us', $uchr)))) {
++$i;
continue;
} else {
$i += $ulen;
}
$i += $ulen;
}
if (isset($map[$uchr])) {
@@ -719,7 +722,7 @@ final class Iconv
private static function pregOffset($offset)
{
$rx = array();
$rx = [];
$offset = (int) $offset;
while ($offset > 65535) {