Skip to content

Commit a0a4d0b

Browse files
[PhpUnitBridge] CS fix
1 parent 5abde37 commit a0a4d0b

File tree

11 files changed

+43
-45
lines changed

11 files changed

+43
-45
lines changed

DnsMock.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ class DnsMock
1818
{
1919
private static $hosts = [];
2020
private static $dnsTypes = [
21-
'A' => DNS_A,
22-
'MX' => DNS_MX,
23-
'NS' => DNS_NS,
24-
'SOA' => DNS_SOA,
25-
'PTR' => DNS_PTR,
26-
'CNAME' => DNS_CNAME,
27-
'AAAA' => DNS_AAAA,
28-
'A6' => DNS_A6,
29-
'SRV' => DNS_SRV,
30-
'NAPTR' => DNS_NAPTR,
31-
'TXT' => DNS_TXT,
32-
'HINFO' => DNS_HINFO,
21+
'A' => \DNS_A,
22+
'MX' => \DNS_MX,
23+
'NS' => \DNS_NS,
24+
'SOA' => \DNS_SOA,
25+
'PTR' => \DNS_PTR,
26+
'CNAME' => \DNS_CNAME,
27+
'AAAA' => \DNS_AAAA,
28+
'A6' => \DNS_A6,
29+
'SRV' => \DNS_SRV,
30+
'NAPTR' => \DNS_NAPTR,
31+
'TXT' => \DNS_TXT,
32+
'HINFO' => \DNS_HINFO,
3333
];
3434

3535
/**
@@ -137,7 +137,7 @@ public static function gethostbynamel($hostname)
137137
return $ips;
138138
}
139139

140-
public static function dns_get_record($hostname, $type = DNS_ANY, &$authns = null, &$addtl = null, $raw = false)
140+
public static function dns_get_record($hostname, $type = \DNS_ANY, &$authns = null, &$addtl = null, $raw = false)
141141
{
142142
if (!self::$hosts) {
143143
return \dns_get_record($hostname, $type, $authns, $addtl, $raw);
@@ -146,8 +146,8 @@ public static function dns_get_record($hostname, $type = DNS_ANY, &$authns = nul
146146
$records = false;
147147

148148
if (isset(self::$hosts[$hostname])) {
149-
if (DNS_ANY === $type) {
150-
$type = DNS_ALL;
149+
if (\DNS_ANY === $type) {
150+
$type = \DNS_ALL;
151151
}
152152
$records = [];
153153

Legacy/PolyfillAssertTrait.php

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use PHPUnit\Framework\Constraint\IsEqual;
1515
use PHPUnit\Framework\Constraint\LogicalNot;
16-
use PHPUnit\Framework\Constraint\RegularExpression;
1716
use PHPUnit\Framework\Constraint\StringContains;
1817
use PHPUnit\Framework\Constraint\TraversableContains;
1918

@@ -228,7 +227,7 @@ public static function assertStringNotContainsStringIgnoringCase($needle, $hayst
228227
public static function assertFinite($actual, $message = '')
229228
{
230229
static::assertInternalType('float', $actual, $message);
231-
static::assertTrue(is_finite($actual), $message ? $message : "Failed asserting that $actual is finite.");
230+
static::assertTrue(is_finite($actual), $message ?: "Failed asserting that $actual is finite.");
232231
}
233232

234233
/**
@@ -239,7 +238,7 @@ public static function assertFinite($actual, $message = '')
239238
public static function assertInfinite($actual, $message = '')
240239
{
241240
static::assertInternalType('float', $actual, $message);
242-
static::assertTrue(is_infinite($actual), $message ? $message : "Failed asserting that $actual is infinite.");
241+
static::assertTrue(is_infinite($actual), $message ?: "Failed asserting that $actual is infinite.");
243242
}
244243

245244
/**
@@ -250,7 +249,7 @@ public static function assertInfinite($actual, $message = '')
250249
public static function assertNan($actual, $message = '')
251250
{
252251
static::assertInternalType('float', $actual, $message);
253-
static::assertTrue(is_nan($actual), $message ? $message : "Failed asserting that $actual is nan.");
252+
static::assertTrue(is_nan($actual), $message ?: "Failed asserting that $actual is nan.");
254253
}
255254

256255
/**
@@ -262,7 +261,7 @@ public static function assertNan($actual, $message = '')
262261
public static function assertIsReadable($filename, $message = '')
263262
{
264263
static::assertInternalType('string', $filename, $message);
265-
static::assertTrue(is_readable($filename), $message ? $message : "Failed asserting that $filename is readable.");
264+
static::assertTrue(is_readable($filename), $message ?: "Failed asserting that $filename is readable.");
266265
}
267266

268267
/**
@@ -274,7 +273,7 @@ public static function assertIsReadable($filename, $message = '')
274273
public static function assertNotIsReadable($filename, $message = '')
275274
{
276275
static::assertInternalType('string', $filename, $message);
277-
static::assertFalse(is_readable($filename), $message ? $message : "Failed asserting that $filename is not readable.");
276+
static::assertFalse(is_readable($filename), $message ?: "Failed asserting that $filename is not readable.");
278277
}
279278

280279
/**
@@ -297,7 +296,7 @@ public static function assertIsNotReadable($filename, $message = '')
297296
public static function assertIsWritable($filename, $message = '')
298297
{
299298
static::assertInternalType('string', $filename, $message);
300-
static::assertTrue(is_writable($filename), $message ? $message : "Failed asserting that $filename is writable.");
299+
static::assertTrue(is_writable($filename), $message ?: "Failed asserting that $filename is writable.");
301300
}
302301

303302
/**
@@ -309,7 +308,7 @@ public static function assertIsWritable($filename, $message = '')
309308
public static function assertNotIsWritable($filename, $message = '')
310309
{
311310
static::assertInternalType('string', $filename, $message);
312-
static::assertFalse(is_writable($filename), $message ? $message : "Failed asserting that $filename is not writable.");
311+
static::assertFalse(is_writable($filename), $message ?: "Failed asserting that $filename is not writable.");
313312
}
314313

315314
/**
@@ -332,7 +331,7 @@ public static function assertIsNotWritable($filename, $message = '')
332331
public static function assertDirectoryExists($directory, $message = '')
333332
{
334333
static::assertInternalType('string', $directory, $message);
335-
static::assertTrue(is_dir($directory), $message ? $message : "Failed asserting that $directory exists.");
334+
static::assertTrue(is_dir($directory), $message ?: "Failed asserting that $directory exists.");
336335
}
337336

338337
/**
@@ -344,7 +343,7 @@ public static function assertDirectoryExists($directory, $message = '')
344343
public static function assertDirectoryNotExists($directory, $message = '')
345344
{
346345
static::assertInternalType('string', $directory, $message);
347-
static::assertFalse(is_dir($directory), $message ? $message : "Failed asserting that $directory does not exist.");
346+
static::assertFalse(is_dir($directory), $message ?: "Failed asserting that $directory does not exist.");
348347
}
349348

350349
/**
@@ -437,7 +436,7 @@ public static function assertDirectoryIsNotWritable($directory, $message = '')
437436
public static function assertFileExists($filename, $message = '')
438437
{
439438
static::assertInternalType('string', $filename, $message);
440-
static::assertTrue(file_exists($filename), $message ? $message : "Failed asserting that $filename exists.");
439+
static::assertTrue(file_exists($filename), $message ?: "Failed asserting that $filename exists.");
441440
}
442441

443442
/**
@@ -449,7 +448,7 @@ public static function assertFileExists($filename, $message = '')
449448
public static function assertFileNotExists($filename, $message = '')
450449
{
451450
static::assertInternalType('string', $filename, $message);
452-
static::assertFalse(file_exists($filename), $message ? $message : "Failed asserting that $filename does not exist.");
451+
static::assertFalse(file_exists($filename), $message ?: "Failed asserting that $filename does not exist.");
453452
}
454453

455454
/**

Legacy/SymfonyTestsListenerTrait.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,9 @@ public function endTest($test, $time)
263263
$error = serialize(['deprecation' => $deprecation[1], 'class' => $className, 'method' => $test->getName(false), 'triggering_file' => isset($deprecation[2]) ? $deprecation[2] : null]);
264264
if ($deprecation[0]) {
265265
// unsilenced on purpose
266-
trigger_error($error, E_USER_DEPRECATED);
266+
trigger_error($error, \E_USER_DEPRECATED);
267267
} else {
268-
@trigger_error($error, E_USER_DEPRECATED);
268+
@trigger_error($error, \E_USER_DEPRECATED);
269269
}
270270
}
271271
$this->runsInSeparateProcess = false;
@@ -302,7 +302,7 @@ public function endTest($test, $time)
302302

303303
public function handleError($type, $msg, $file, $line, $context = [])
304304
{
305-
if (E_USER_DEPRECATED !== $type && E_DEPRECATED !== $type) {
305+
if (\E_USER_DEPRECATED !== $type && \E_DEPRECATED !== $type) {
306306
$h = $this->previousErrorHandler;
307307

308308
return $h ? $h($type, $msg, $file, $line, $context) : false;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<?php
22

3-
@trigger_error('I come from… afar! :D', E_USER_DEPRECATED);
3+
@trigger_error('I come from… afar! :D', \E_USER_DEPRECATED);

Tests/DeprecationErrorHandler/fake_app/AppService.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@ public function directDeprecations()
1616
$service2->deprecatedApi();
1717
}
1818
}
19-

Tests/DeprecationErrorHandler/fake_vendor/acme/lib/SomeService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public function deprecatedApi()
88
{
99
@trigger_error(
1010
__FUNCTION__.' is deprecated! You should stop relying on it!',
11-
E_USER_DEPRECATED
11+
\E_USER_DEPRECATED
1212
);
1313
}
1414
}

Tests/DeprecationErrorHandler/fake_vendor/acme/lib/deprecation_riddled.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,22 @@ public static function getGroups()
1313
EOPHP
1414
);
1515

16-
@trigger_error('root deprecation', E_USER_DEPRECATED);
16+
@trigger_error('root deprecation', \E_USER_DEPRECATED);
1717

1818
class FooTestCase
1919
{
2020
public function testLegacyFoo()
2121
{
22-
@trigger_error('silenced foo deprecation', E_USER_DEPRECATED);
23-
trigger_error('unsilenced foo deprecation', E_USER_DEPRECATED);
24-
@trigger_error('silenced foo deprecation', E_USER_DEPRECATED);
25-
trigger_error('unsilenced foo deprecation', E_USER_DEPRECATED);
22+
@trigger_error('silenced foo deprecation', \E_USER_DEPRECATED);
23+
trigger_error('unsilenced foo deprecation', \E_USER_DEPRECATED);
24+
@trigger_error('silenced foo deprecation', \E_USER_DEPRECATED);
25+
trigger_error('unsilenced foo deprecation', \E_USER_DEPRECATED);
2626
}
2727

2828
public function testNonLegacyBar()
2929
{
30-
@trigger_error('silenced bar deprecation', E_USER_DEPRECATED);
31-
trigger_error('unsilenced bar deprecation', E_USER_DEPRECATED);
30+
@trigger_error('silenced bar deprecation', \E_USER_DEPRECATED);
31+
trigger_error('unsilenced bar deprecation', \E_USER_DEPRECATED);
3232
}
3333
}
3434

Tests/DeprecationErrorHandler/fake_vendor/composer/autoload_real.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function loadClass($className)
2626
public function findFile($class)
2727
{
2828
foreach ($this->getPrefixesPsr4() as $prefix => $baseDirs) {
29-
if (strpos($class, $prefix) !== 0) {
29+
if (0 !== strpos($class, $prefix)) {
3030
continue;
3131
}
3232

Tests/DeprecationErrorHandler/fake_vendor_bis/composer/autoload_real.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function getPrefixesPsr4()
1717
public function loadClass($className)
1818
{
1919
foreach ($this->getPrefixesPsr4() as $prefix => $baseDirs) {
20-
if (strpos($className, $prefix) !== 0) {
20+
if (0 !== strpos($className, $prefix)) {
2121
continue;
2222
}
2323

Tests/DeprecationErrorHandler/fake_vendor_bis/foo/lib/SomeOtherService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public function deprecatedApi()
88
{
99
@trigger_error(
1010
__FUNCTION__.' from foo is deprecated! You should stop relying on it!',
11-
E_USER_DEPRECATED
11+
\E_USER_DEPRECATED
1212
);
1313
}
1414
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?php
22

3-
$phar = new Phar(__DIR__.DIRECTORY_SEPARATOR.'deprecation.phar', 0, 'deprecation.phar');
4-
$phar->buildFromDirectory(__DIR__.DIRECTORY_SEPARATOR.'deprecation');
3+
$phar = new Phar(__DIR__.\DIRECTORY_SEPARATOR.'deprecation.phar', 0, 'deprecation.phar');
4+
$phar->buildFromDirectory(__DIR__.\DIRECTORY_SEPARATOR.'deprecation');

0 commit comments

Comments
 (0)