summaryrefslogtreecommitdiff
path: root/vendor/symfony/polyfill-php72
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@webtrees.net>2018-05-05 09:58:27 +0100
committerGreg Roach <fisharebest@webtrees.net>2018-05-05 09:58:27 +0100
commitba391482feb627863a35447b872beb5a66f5b812 (patch)
tree1e3bef06b76d6bd094077d618c5be983e7d07df9 /vendor/symfony/polyfill-php72
parent6e30ebe39699db45c44565093ae56b5d06c8ae8b (diff)
downloadwebtrees-ba391482feb627863a35447b872beb5a66f5b812.tar.gz
webtrees-ba391482feb627863a35447b872beb5a66f5b812.tar.bz2
webtrees-ba391482feb627863a35447b872beb5a66f5b812.zip
Update PHP dependencies
Diffstat (limited to 'vendor/symfony/polyfill-php72')
-rw-r--r--vendor/symfony/polyfill-php72/Php72.php31
-rw-r--r--vendor/symfony/polyfill-php72/composer.json2
2 files changed, 25 insertions, 8 deletions
diff --git a/vendor/symfony/polyfill-php72/Php72.php b/vendor/symfony/polyfill-php72/Php72.php
index 39f144caa3..cf9943b4f6 100644
--- a/vendor/symfony/polyfill-php72/Php72.php
+++ b/vendor/symfony/polyfill-php72/Php72.php
@@ -24,13 +24,13 @@ final class Php72
public static function utf8_encode($s)
{
$s .= $s;
- $len = strlen($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;
+ default: $s[$j] = "\xC3"; $s[++$j] = \chr(\ord($s[$i]) - 64); break;
}
}
@@ -40,14 +40,14 @@ final class Php72
public static function utf8_decode($s)
{
$s = (string) $s;
- $len = strlen($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) : '?';
+ $c = (\ord($s[$i] & "\x1F") << 6) | \ord($s[++$i] & "\x3F");
+ $s[$j] = $c < 256 ? \chr($c) : '?';
break;
case "\xF0": ++$i;
@@ -97,13 +97,25 @@ final class Php72
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', stream_get_meta_data($stream));
+ $meta = array_map('strtolower', $meta);
$stdin = 'php://stdin' === $meta['uri'] || 'php://fd/0' === $meta['uri'];
return !$stdin
@@ -114,6 +126,11 @@ final class Php72
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
@@ -131,7 +148,7 @@ final class Php72
// 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)) {
+ if (isset($frame['function'][0]) && !isset($frame['class']) && 'o' === $frame['function'][0] && \in_array($frame['function'], $obFuncs)) {
$frame['line'] = 0;
break;
}
diff --git a/vendor/symfony/polyfill-php72/composer.json b/vendor/symfony/polyfill-php72/composer.json
index b58c88a343..b499b1d09c 100644
--- a/vendor/symfony/polyfill-php72/composer.json
+++ b/vendor/symfony/polyfill-php72/composer.json
@@ -25,7 +25,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
- "dev-master": "1.7-dev"
+ "dev-master": "1.8-dev"
}
}
}