8000 Enable the fixer enforcing fully-qualified calls for compiler-optimiz… · symfony/phpunit-bridge@fe3fca1 · GitHub
[go: up one dir, main page]

Skip to content

Commit fe3fca1

Browse files
committed
Enable the fixer enforcing fully-qualified calls for compiler-optimized functions
1 parent 93a9a78 commit fe3fca1

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

ClockMock.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,15 @@ public static function microtime($asFloat = false)
7171

7272
public static function register($class)
7373
{
74-
$self = get_called_class();
74+
$self = \get_called_class();
7575

7676
$mockedNs = array(substr($class, 0, strrpos($class, '\\')));
7777
if (strpos($class, '\\Tests\\')) {
7878
$ns = str_replace('\\Tests\\', '\\', $class);
7979
$mockedNs[] = substr($ns, 0, strrpos($ns, '\\'));
8080
}
8181
foreach ($mockedNs as $ns) {
82-
if (function_exists($ns.'\time')) {
82+
if (\function_exists($ns.'\time')) {
8383
continue;
8484
}
8585
eval(<<<EOPHP

DeprecationErrorHandler.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ public static function register($mode = 0)
7575
$trace = debug_backtrace(true);
7676
$group = 'other';
7777

78-
$i = count($trace);
78+
$i = \count($trace);
7979
while (1 < $i && (!isset($trace[--$i]['class']) || ('ReflectionMethod' === $trace[$i]['class'] || 0 === strpos($trace[$i]['class'], 'PHPUnit_')))) {
8080
// No-op
8181
}
8282

8383
if (isset($trace[$i]['object']) || isset($trace[$i]['class'])) {
84-
$class = isset($trace[$i]['object']) ? get_class($trace[$i]['object']) : $trace[$i]['class'];
84+
$class = isset($trace[$i]['object']) ? \get_class($trace[$i]['object']) : $trace[$i]['class'];
8585
$method = $trace[$i]['function'];
8686

8787
if (0 !== error_reporting()) {
@@ -90,7 +90,7 @@ public static function register($mode = 0)
9090
|| 0 === strpos($method, 'provideLegacy')
9191
|| 0 === strpos($method, 'getLegacy')
9292
|| strpos($class, '\Legacy')
93-
|| in_array('legacy', \PHPUnit_Util_Test::getGroups($class, $method), true)
93+
|| \in_array('legacy', \PHPUnit_Util_Test::getGroups($class, $method), true)
9494
) {
9595
$group = 'legacy';
9696
} else {
@@ -101,7 +101,7 @@ public static function register($mode = 0)
101101
$e = new \Exception($msg);
102102
$r = new \ReflectionProperty($e, 'trace');
103103
$r->setAccessible(true);
104-
$r->setValue($e, array_slice($trace, 1, $i));
104+
$r->setValue($e, \array_slice($trace, 1, $i));
105105

106106
echo "\n".ucfirst($group).' deprecation triggered by '.$class.'::'.$method.':';
107107
echo "\n".$msg;
@@ -193,12 +193,12 @@ public static function register($mode = 0)
193193

194194
// reset deprecations array
195195
foreach ($deprecations as $group => $arrayOrInt) {
196-
$deprecations[$group] = is_int($arrayOrInt) ? 0 : array();
196+
$deprecations[$group] = \is_int($arrayOrInt) ? 0 : array();
197197
}
198198

199199
register_shutdown_function(function () use (&$deprecations, $isFailing, $displayDeprecations, $mode) {
200200
foreach ($deprecations as $group => $arrayOrInt) {
201-
if (0 < (is_int($arrayOrInt) ? $arrayOrInt : count($arrayOrInt))) {
201+
if (0 < (\is_int($arrayOrInt) ? $arrayOrInt : \count($arrayOrInt))) {
202202
echo "Shutdown-time deprecations:\n";
203203
break;
204204
}
@@ -222,7 +222,7 @@ public static function register($mode = 0)
222222
*/
223223
private static function hasColorSupport()
224224
{
225-
if (!defined('STDOUT')) {
225+
if (!\defined('STDOUT')) {
226226
return false;
227227
}
228228

@@ -231,18 +231,18 @@ private static function hasColorSupport()
231231
}
232232

233233
if (DIRECTORY_SEPARATOR === '\\') {
234-
return (function_exists('sapi_windows_vt100_support')
234+
return (\function_exists('sapi_windows_vt100_support')
235235
&& sapi_windows_vt100_support(STDOUT))
236236
|| false !== getenv('ANSICON')
237237
|| 'ON' === getenv('ConEmuANSI')
238238
|| 'xterm' === getenv('TERM');
239239
}
240240

241-
if (function_exists('stream_isatty')) {
241+
if (\function_exists('stream_isatty')) {
242242
return stream_isatty(STDOUT);
243243
}
244244

245-
if (function_exists('posix_isatty')) {
245+
if (\function_exists('posix_isatty')) {
246246
return posix_isatty(STDOUT);
247247
}
248248

TextUI/Command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ protected function handleBootstrap($filename)
3838
// By default, we want PHPUnit's autoloader before Symfony's one
3939
if (!getenv('SYMFONY_PHPUNIT_OVERLOAD')) {
4040
$filename = realpath(stream_resolve_include_path($filename));
41-
$symfonyLoader = realpath(dirname(PHPUNIT_COMPOSER_INSTALL).'/../../../vendor/autoload.php');
41+
$symfonyLoader = realpath(\dirname(PHPUNIT_COMPOSER_INSTALL).'/../../../vendor/autoload.php');
4242

4343
if ($filename === $symfonyLoader) {
4444
$symfonyLoader = require $symfonyLoader;

0 commit comments

Comments
 (0)
0