Skip to content

Commit 6b70024

Browse files
Enable "native_constant_invocation" CS rule
1 parent 03f8311 commit 6b70024

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

DeprecationErrorHandler.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public static function register($mode = 0)
109109
'remaining vendor' => array(),
110110
);
111111
$deprecationHandler = function ($type, $msg, $file, $line, $context = array()) use (&$deprecations, $getMode, $UtilPrefix, $inVendors) {
112-
if ((E_USER_DEPRECATED !== $type && E_DEPRECATED !== $type && (E_WARNING !== $type || false === strpos($msg, '" targeting switch is equivalent to "break'))) || DeprecationErrorHandler::MODE_DISABLED === $mode = $getMode()) {
112+
if ((\E_USER_DEPRECATED !== $type && \E_DEPRECATED !== $type && (\E_WARNING !== $type || false === strpos($msg, '" targeting switch is equivalent to "break'))) || DeprecationErrorHandler::MODE_DISABLED === $mode = $getMode()) {
113113
return \call_user_func(DeprecationErrorHandler::getPhpUnitErrorHandler(), $type, $msg, $file, $line, $context);
114114
}
115115

@@ -285,7 +285,7 @@ public static function collectDeprecations($outputFile)
285285
{
286286
$deprecations = array();
287287
$previousErrorHandler = set_error_handler(function ($type, $msg, $file, $line, $context = array()) use (&$deprecations, &$previousErrorHandler) {
288-
if (E_USER_DEPRECATED !== $type && E_DEPRECATED !== $type && (E_WARNING !== $type || false === strpos($msg, '" targeting switch is equivalent to "break'))) {
288+
if (\E_USER_DEPRECATED !== $type && \E_DEPRECATED !== $type && (\E_WARNING !== $type || false === strpos($msg, '" targeting switch is equivalent to "break'))) {
289289
if ($previousErrorHandler) {
290290
return $previousErrorHandler($type, $msg, $file, $line, $context);
291291
}
@@ -314,7 +314,7 @@ public static function getPhpUnitErrorHandler()
314314
return (class_exists('PHPUnit_Util_ErrorHandler', false) ? 'PHPUnit_Util_' : 'PHPUnit\Util\\').'ErrorHandler::handleError';
315315
}
316316

317-
foreach (debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT | DEBUG_BACKTRACE_IGNORE_ARGS) as $frame) {
317+
foreach (debug_backtrace(\DEBUG_BACKTRACE_PROVIDE_OBJECT | \DEBUG_BACKTRACE_IGNORE_ARGS) as $frame) {
318318
if (isset($frame['object']) && $frame['object'] instanceof TestResult) {
319319
return new ErrorHandler(
320320
$frame['object']->getConvertDeprecationsToExceptions(),
@@ -348,21 +348,21 @@ private static function hasColorSupport()
348348

349349
if (\DIRECTORY_SEPARATOR === '\\') {
350350
return (\function_exists('sapi_windows_vt100_support')
351-
&& sapi_windows_vt100_support(STDOUT))
351+
&& sapi_windows_vt100_support(\STDOUT))
352352
|| false !== getenv('ANSICON')
353353
|| 'ON' === getenv('ConEmuANSI')
354354
|| 'xterm' === getenv('TERM');
355355
}
356356

357357
if (\function_exists('stream_isatty')) {
358-
return stream_isatty(STDOUT);
358+
return stream_isatty(\STDOUT);
359359
}
360360

361361
if (\function_exists('posix_isatty')) {
362-
return posix_isatty(STDOUT);
362+
return posix_isatty(\STDOUT);
363363
}
364364

365-
$stat = fstat(STDOUT);
365+
$stat = fstat(\STDOUT);
366366
// Check if formatted mode is S_IFCHR
367367
return $stat ? 0020000 === ($stat['mode'] & 0170000) : false;
368368
}

Tests/DnsMockTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ public function testDnsGetRecord()
141141

142142
$this->assertFalse(DnsMock::dns_get_record('foobar.com'));
143143
$this->assertSame($records, DnsMock::dns_get_record('example.com'));
144-
$this->assertSame($records, DnsMock::dns_get_record('example.com', DNS_ALL));
145-
$this->assertSame($records, DnsMock::dns_get_record('example.com', DNS_A | DNS_PTR));
146-
$this->assertSame(array($ptr), DnsMock::dns_get_record('example.com', DNS_PTR));
144+
$this->assertSame($records, DnsMock::dns_get_record('example.com', \DNS_ALL));
145+
$this->assertSame($records, DnsMock::dns_get_record('example.com', \DNS_A | \DNS_PTR));
146+
$this->assertSame(array($ptr), DnsMock::dns_get_record('example.com', \DNS_PTR));
147147
}
148148
}

Tests/ExpectedDeprecationAnnotationTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ final class ExpectedDeprecationAnnotationTest extends TestCase
2424
*/
2525
public function testOne()
2626
{
27-
@trigger_error('foo', E_USER_DEPRECATED);
27+
@trigger_error('foo', \E_USER_DEPRECATED);
2828
}
2929

3030
/**
@@ -37,7 +37,7 @@ public function testOne()
3737
*/
3838
public function testMany()
3939
{
40-
@trigger_error('foo', E_USER_DEPRECATED);
41-
@trigger_error('bar', E_USER_DEPRECATED);
40+
@trigger_error('foo', \E_USER_DEPRECATED);
41+
@trigger_error('bar', \E_USER_DEPRECATED);
4242
}
4343
}

Tests/ProcessIsolationTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class ProcessIsolationTest extends TestCase
1818
*/
1919
public function testIsolation()
2020
{
21-
@trigger_error('Test abc', E_USER_DEPRECATED);
21+
@trigger_error('Test abc', \E_USER_DEPRECATED);
2222
$this->addToAssertionCount(1);
2323
}
2424

@@ -28,6 +28,6 @@ public function testCallingOtherErrorHandler()
2828
$this->expectException($class);
2929
$this->expectExceptionMessage('Test that PHPUnit\'s error handler fires.');
3030

31-
trigger_error('Test that PHPUnit\'s error handler fires.', E_USER_WARNING);
31+
trigger_error('Test that PHPUnit\'s error handler fires.', \E_USER_WARNING);
3232
}
3333
}

bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
}
2626

2727
// Enforce a consistent locale
28-
setlocale(LC_ALL, 'C');
28+
setlocale(\LC_ALL, 'C');
2929

3030
if (!class_exists('Doctrine\Common\Annotations\AnnotationRegistry', false) && class_exists('Doctrine\Common\Annotations\AnnotationRegistry')) {
3131
if (method_exists('Doctrine\Common\Annotations\AnnotationRegistry', 'registerUniqueLoader')) {

0 commit comments

Comments
 (0)