Skip to content

Commit e1846c8

Browse files
Fix CS/WS issues
1 parent 3b58e65 commit e1846c8

File tree

6 files changed

+18
-7
lines changed

6 files changed

+18
-7
lines changed

src/Runner/PhptTestCase.php

+1
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,7 @@ private function cleanupForCoverage(): RawCodeCoverageData
639639
$files = $this->getCoverageFiles();
640640

641641
$buffer = false;
642+
642643
if (is_file($files['coverage'])) {
643644
$buffer = @file_get_contents($files['coverage']);
644645
}

src/Runner/ResultCache/DefaultResultCache.php

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use function file_put_contents;
1818
use function is_array;
1919
use function is_dir;
20+
use function is_file;
2021
use function json_decode;
2122
use function json_encode;
2223
use PHPUnit\Framework\TestStatus\TestStatus;
@@ -88,6 +89,7 @@ public function load(): void
8889
if (!is_file($this->cacheFilename)) {
8990
return;
9091
}
92+
9193
$contents = file_get_contents($this->cacheFilename);
9294

9395
if ($contents === false) {

src/TextUI/Application.php

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
namespace PHPUnit\TextUI;
1111

1212
use const PHP_EOL;
13+
use function is_file;
1314
use function is_readable;
1415
use function printf;
1516
use function realpath;

src/Util/PHP/AbstractPhpProcess.php

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use function array_merge;
1515
use function assert;
1616
use function escapeshellarg;
17+
use function file_exists;
1718
use function file_get_contents;
1819
use function ini_get_all;
1920
use function restore_error_handler;
@@ -142,6 +143,7 @@ public function runTestJob(string $job, Test $test, string $processResultFile):
142143

143144
if (file_exists($processResultFile)) {
144145
$processResult = file_get_contents($processResultFile);
146+
145147
@unlink($processResultFile);
146148
}
147149

tests/end-to-end/regression/5764/error-handler.php

+12-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
<?php
2-
3-
// be forgiving with error handlers which do not suppress `@` prefixed lines
4-
set_error_handler(function(int $err_lvl, string $err_msg, string $err_file, int $err_line): bool {
5-
throw new \ErrorException($err_msg, 0, $err_lvl, $err_file, $err_line);
1+
<?php declare(strict_types=1);
2+
/*
3+
* This file is part of PHPUnit.
4+
*
5+
* (c) Sebastian Bergmann <[email protected]>
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
9+
*/
10+
\set_error_handler(static function (int $err_lvl, string $err_msg, string $err_file, int $err_line): bool
11+
{
12+
throw new ErrorException($err_msg, 0, $err_lvl, $err_file, $err_line);
613
});
7-

tests/end-to-end/regression/5764/tests/Issue5764Test.php

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
*/
1010
namespace PHPUnit\TestFixture\Issue5764;
1111

12-
use Exception;
1312
use PHPUnit\Framework\TestCase;
1413

1514
final class Issue5764Test extends TestCase

0 commit comments

Comments
 (0)