Skip to content

Commit 6b32fd8

Browse files
Update and apply CS rules
1 parent 4a4465f commit 6b32fd8

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

Php72.php

+9-9
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,17 @@ public static function php_os_family()
7373
return 'Windows';
7474
}
7575

76-
$map = array(
76+
$map = [
7777
'Darwin' => 'Darwin',
7878
'DragonFly' => 'BSD',
7979
'FreeBSD' => 'BSD',
8080
'NetBSD' => 'BSD',
8181
'OpenBSD' => 'BSD',
8282
'Linux' => 'Linux',
8383
'SunOS' => 'Solaris',
84-
);
84+
];
8585

86-
return isset($map[PHP_OS]) ? $map[PHP_OS] : 'Unknown';
86+
return isset($map[\PHP_OS]) ? $map[\PHP_OS] : 'Unknown';
8787
}
8888

8989
public static function spl_object_id($object)
@@ -102,15 +102,15 @@ public static function spl_object_id($object)
102102
public static function sapi_windows_vt100_support($stream, $enable = null)
103103
{
104104
if (!\is_resource($stream)) {
105-
trigger_error('sapi_windows_vt100_support() expects parameter 1 to be resource, '.\gettype($stream).' given', E_USER_WARNING);
105+
trigger_error('sapi_windows_vt100_support() expects parameter 1 to be resource, '.\gettype($stream).' given', \E_USER_WARNING);
106106

107107
return false;
108108
}
109109

110110
$meta = stream_get_meta_data($stream);
111111

112112
if ('STDIO' !== $meta['stream_type']) {
113-
trigger_error('sapi_windows_vt100_support() was not able to analyze the specified stream', E_USER_WARNING);
113+
trigger_error('sapi_windows_vt100_support() was not able to analyze the specified stream', \E_USER_WARNING);
114114

115115
return false;
116116
}
@@ -134,7 +134,7 @@ public static function sapi_windows_vt100_support($stream, $enable = null)
134134
public static function stream_isatty($stream)
135135
{
136136
if (!\is_resource($stream)) {
137-
trigger_error('stream_isatty() expects parameter 1 to be resource, '.\gettype($stream).' given', E_USER_WARNING);
137+
trigger_error('stream_isatty() expects parameter 1 to be resource, '.\gettype($stream).' given', \E_USER_WARNING);
138138

139139
return false;
140140
}
@@ -150,12 +150,12 @@ public static function stream_isatty($stream)
150150

151151
private static function initHashMask()
152152
{
153-
$obj = (object) array();
153+
$obj = (object) [];
154154
self::$hashMask = -1;
155155

156156
// check if we are nested in an output buffering handler to prevent a fatal error with ob_start() below
157-
$obFuncs = array('ob_clean', 'ob_end_clean', 'ob_flush', 'ob_end_flush', 'ob_get_contents', 'ob_get_flush');
158-
foreach (debug_backtrace(\PHP_VERSION_ID >= 50400 ? DEBUG_BACKTRACE_IGNORE_ARGS : false) as $frame) {
157+
$obFuncs = ['ob_clean', 'ob_end_clean', 'ob_flush', 'ob_end_flush', 'ob_get_contents', 'ob_get_flush'];
158+
foreach (debug_backtrace(\PHP_VERSION_ID >= 50400 ? \DEBUG_BACKTRACE_IGNORE_ARGS : false) as $frame) {
159159
if (isset($frame['function'][0]) && !isset($frame['class']) && 'o' === $frame['function'][0] && \in_array($frame['function'], $obFuncs)) {
160160
$frame['line'] = 0;
161161
break;

bootstrap.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
use Symfony\Polyfill\Php72 as p;
1313

14-
if (PHP_VERSION_ID >= 70200) {
14+
if (\PHP_VERSION_ID >= 70200) {
1515
return;
1616
}
1717

@@ -31,7 +31,7 @@
3131
define('PHP_OS_FAMILY', p\Php72::php_os_family());
3232
}
3333

34-
if ('\\' === DIRECTORY_SEPARATOR && !function_exists('sapi_windows_vt100_support')) {
34+
if ('\\' === \DIRECTORY_SEPARATOR && !function_exists('sapi_windows_vt100_support')) {
3535
function sapi_windows_vt100_support($stream, $enable = null) { return p\Php72::sapi_windows_vt100_support($stream, $enable); }
3636
}
3737
if (!function_exists('stream_isatty')) {

0 commit comments

Comments
 (0)