Skip to content

Commit 0ff8876

Browse files
CS fix
1 parent 2e000ff commit 0ff8876

File tree

1 file changed

+24
-23
lines changed

1 file changed

+24
-23
lines changed

tests/Php82/Php82Test.php

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -259,47 +259,47 @@ public function testIniParseQuantityZeroWithMultiplier()
259259
error_clear_last();
260260
$this->assertSame(0, @ini_parse_quantity(' 0 K '));
261261
$this->assertSame('Invalid prefix "0 ", interpreting as "0" for backwards compatibility', error_get_last()['message']);
262-
$this->assertContains(error_get_last()['type'], [E_WARNING, E_USER_WARNING]);
262+
$this->assertContains(error_get_last()['type'], [\E_WARNING, \E_USER_WARNING]);
263263
}
264264

265265
public function testIniParseQuantityNoValidLeadingDigits()
266266
{
267267
error_clear_last();
268268
$this->assertSame(0, @ini_parse_quantity(' foo '));
269269
$this->assertSame('Invalid quantity " foo ": no valid leading digits, interpreting as "0" for backwards compatibility', error_get_last()['message']);
270-
$this->assertContains(error_get_last()['type'], [E_WARNING, E_USER_WARNING]);
270+
$this->assertContains(error_get_last()['type'], [\E_WARNING, \E_USER_WARNING]);
271271
}
272272

273273
public function testIniParseQuantityUnknownMultiplier()
274274
{
275275
error_clear_last();
276276
$this->assertSame(2, @ini_parse_quantity(' 0b102 '));
277277
$this->assertSame('Invalid quantity " 0b102 ": unknown multiplier "2", interpreting as " 0b10" for backwards compatibility', error_get_last()['message']);
278-
$this->assertContains(error_get_last()['type'], [E_WARNING, E_USER_WARNING]);
278+
$this->assertContains(error_get_last()['type'], [\E_WARNING, \E_USER_WARNING]);
279279
}
280280

281281
public function testIniParseQuantityNoDigitsAfterBasePrefix()
282282
{
283283
error_clear_last();
284284
$this->assertSame(0, @ini_parse_quantity(' 0x '));
285285
$this->assertSame('Invalid quantity " 0x ": no digits after base prefix, interpreting as "0" for backwards compatibility', error_get_last()['message']);
286-
$this->assertContains(error_get_last()['type'], [E_WARNING, E_USER_WARNING]);
286+
$this->assertContains(error_get_last()['type'], [\E_WARNING, \E_USER_WARNING]);
287287
}
288288

289289
public function testIniParseQuantityInvalidPrefix()
290290
{
291291
error_clear_last();
292292
$this->assertSame(0, @ini_parse_quantity('0q12'));
293293
$this->assertSame('Invalid prefix "0q", interpreting as "0" for backwards compatibility', error_get_last()['message']);
294-
$this->assertContains(error_get_last()['type'], [E_WARNING, E_USER_WARNING]);
294+
$this->assertContains(error_get_last()['type'], [\E_WARNING, \E_USER_WARNING]);
295295
}
296296

297297
public function testIniParseQuantityInvalidQuantity()
298298
{
299299
error_clear_last();
300300
$this->assertSame(10240, @ini_parse_quantity(' 10 kk '));
301301
$this->assertSame('Invalid quantity " 10 kk ", interpreting as " 10 k" for backwards compatibility', error_get_last()['message']);
302-
$this->assertContains(error_get_last()['type'], [E_WARNING, E_USER_WARNING]);
302+
$this->assertContains(error_get_last()['type'], [\E_WARNING, \E_USER_WARNING]);
303303
}
304304

305305
public function testIniParseQuantityNoLeadingDigits()
@@ -308,47 +308,47 @@ public function testIniParseQuantityNoLeadingDigits()
308308
error_clear_last();
309309
$this->assertSame(0, @ini_parse_quantity(' K '));
310310
$this->assertSame('Invalid quantity " K ": no valid leading digits, interpreting as "0" for backwards compatibility', error_get_last()['message']);
311-
$this->assertContains(error_get_last()['type'], [E_WARNING, E_USER_WARNING]);
311+
$this->assertContains(error_get_last()['type'], [\E_WARNING, \E_USER_WARNING]);
312312
}
313313

314314
public function testIniParseQuantityOutOfRange()
315315
{
316316
error_clear_last();
317317
$this->assertSame(-4096, @ini_parse_quantity(' 0x-4K '));
318318
$this->assertSame('Invalid quantity " 0x-4K ": value is out of range, using overflow result for backwards compatibility', error_get_last()['message']);
319-
$this->assertContains(error_get_last()['type'], [E_WARNING, E_USER_WARNING]);
319+
$this->assertContains(error_get_last()['type'], [\E_WARNING, \E_USER_WARNING]);
320320
}
321321

322322
public function testIniParseQuantityOverflowTooManyDigits()
323323
{
324324
error_clear_last();
325325
$this->assertSame(-1, @ini_parse_quantity(' 99999999999999999999 '));
326326
$this->assertSame('Invalid quantity " 99999999999999999999 ": value is out of range, using overflow result for backwards compatibility', error_get_last()['message']);
327-
$this->assertContains(error_get_last()['type'], [E_WARNING, E_USER_WARNING]);
327+
$this->assertContains(error_get_last()['type'], [\E_WARNING, \E_USER_WARNING]);
328328
}
329329

330330
public function testIniParseQuantityOverflowWithMultiplier()
331331
{
332332
error_clear_last();
333333
$this->assertSame(-7709325833709551616, @ini_parse_quantity(' 10000000000G '));
334334
$this->assertSame('Invalid quantity " 10000000000G ": value is out of range, using overflow result for backwards compatibility', error_get_last()['message']);
335-
$this->assertContains(error_get_last()['type'], [E_WARNING, E_USER_WARNING]);
335+
$this->assertContains(error_get_last()['type'], [\E_WARNING, \E_USER_WARNING]);
336336
}
337337

338338
public function testIniParseQuantitySignAfterPrefixButNoDigits()
339339
{
340340
error_clear_last();
341341
$this->assertSame(0, @ini_parse_quantity(' 0b- '));
342342
$this->assertSame('Invalid quantity " 0b- ": no valid leading digits, interpreting as "0" for backwards compatibility', error_get_last()['message']);
343-
$this->assertContains(error_get_last()['type'], [E_WARNING, E_USER_WARNING]);
343+
$this->assertContains(error_get_last()['type'], [\E_WARNING, \E_USER_WARNING]);
344344
}
345345

346346
public function testIniParseQuantitySpecialCharactersAreEscaped()
347347
{
348348
error_clear_last();
349349
$this->assertSame(0, @ini_parse_quantity("w-\n-\r-\t-\v-\f-\\-\x1B-\xCC-"));
350350
$this->assertSame('Invalid quantity "w-\\n-\\r-\\t-\\v-\\f-\\\\-\\e-\\xCC-": no valid leading digits, interpreting as "0" for backwards compatibility', error_get_last()['message']);
351-
$this->assertContains(error_get_last()['type'], [E_WARNING, E_USER_WARNING]);
351+
$this->assertContains(error_get_last()['type'], [\E_WARNING, \E_USER_WARNING]);
352352
}
353353

354354
/**
@@ -357,27 +357,28 @@ public function testIniParseQuantitySpecialCharactersAreEscaped()
357357
*/
358358
public function testIniParseQuantityUsingBruteForce()
359359
{
360-
if (PHP_VERSION_ID < 80200) {
360+
if (\PHP_VERSION_ID < 80200) {
361361
$this->markTestSkipped('This test requires the PHP function as a reference.');
362362

363363
return;
364364
}
365365

366366
// Comment these lines to run the tests.
367367
$this->markTestSkipped('This test is slow and should only be used for local development.');
368+
368369
return;
369370

370371
$fn = function (string $test): void {
371372
error_clear_last();
372-
$x = @ini_parse_quantity($test);
373+
$x = @ini_parse_quantity($test);
373374
$err_x = error_get_last()['message'] ?? '';
374375

375376
error_clear_last();
376-
$y = @ini_parse_quantity($test);
377+
$y = @ini_parse_quantity($test);
377378
$err_y = error_get_last()['message'] ?? '';
378379

379-
$this->assertSame($x, $y, 'Testing "' . $test . '"');
380-
$this->assertSame($err_x, $err_y, 'Testing "' . $test . '"');
380+
$this->assertSame($x, $y, 'Testing "'.$test.'"');
381+
$this->assertSame($err_x, $err_y, 'Testing "'.$test.'"');
381382
};
382383

383384
$chars = [' ', '-', '+', '0', '1', '7', '9', 'a', 'b', 'o', 'f', 'g', 'k', 'm', 'x', 'z', '\\'];
@@ -388,22 +389,22 @@ public function testIniParseQuantityUsingBruteForce()
388389
$fn($char1);
389390

390391
foreach ($chars as $char2) {
391-
$fn($char1 . $char2);
392+
$fn($char1.$char2);
392393

393394
foreach ($chars as $char3) {
394-
$fn($char1 . $char2 . $char3);
395+
$fn($char1.$char2.$char3);
395396

396397
foreach ($chars as $char4) {
397-
$fn($char1 . $char2 . $char3 . $char4);
398+
$fn($char1.$char2.$char3.$char4);
398399

399400
foreach ($chars as $char5) {
400-
$fn($char1 . $char2 . $char3 . $char4 . $char5);
401+
$fn($char1.$char2.$char3.$char4.$char5);
401402

402403
foreach ($chars as $char6) {
403-
$fn($char1 . $char2 . $char3 . $char4 . $char5 . $char6);
404+
$fn($char1.$char2.$char3.$char4.$char5.$char6);
404405

405406
foreach ($chars as $char7) {
406-
$fn($char1 . $char2 . $char3 . $char4 . $char5 . $char6 . $char7);
407+
$fn($char1.$char2.$char3.$char4.$char5.$char6.$char7);
407408
}
408409
}
409410
}

0 commit comments

Comments
 (0)