Skip to content

Commit

Permalink
Fix CS/WS issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Sep 27, 2018
1 parent 4b45340 commit d278688
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/TextUI/TestRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
use PHPUnit\Util\TestDox\HtmlResultPrinter;
use PHPUnit\Util\TestDox\TextResultPrinter;
use PHPUnit\Util\TestDox\XmlResultPrinter;
use PHPUnit\Util\XDebugFilterScriptGenerator;
use PHPUnit\Util\XdebugFilterScriptGenerator;
use ReflectionClass;
use SebastianBergmann\CodeCoverage\CodeCoverage;
use SebastianBergmann\CodeCoverage\Exception as CodeCoverageException;
Expand Down Expand Up @@ -543,7 +543,7 @@ public function doRun(Test $suite, array $arguments = [], bool $exit = true): Te
}

if (isset($arguments['xdebugFilterFile'], $filterConfiguration)) {
$filterScriptGenerator = new XDebugFilterScriptGenerator();
$filterScriptGenerator = new XdebugFilterScriptGenerator;
$script = $filterScriptGenerator->generate($filterConfiguration['whitelist']);
\file_put_contents($arguments['xdebugFilterFile'], $script);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,22 @@
*/
namespace PHPUnit\Util;

class XDebugFilterScriptGenerator
final class XdebugFilterScriptGenerator
{
public function generate(array $filterData): string
{
$items = $this->getWhitelistItems($filterData);

$files = \array_map(function ($item) {
return \sprintf(" '%s'", $item);
}, $items);
$files = \array_map(
function ($item) {
return \sprintf(
" '%s'",
$item
);
},
$items
);

$files = \implode(",\n", $files);

return <<<EOF
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/Util/XDebugFilterScriptGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class XDebugFilterScriptGeneratorTest extends TestCase
{
/**
* @covers \PHPUnit\Util\XDebugFilterScriptGenerator::generate
* @covers \PHPUnit\Util\XdebugFilterScriptGenerator::generate
*/
public function testReturnsExpectedScript(): void
{
Expand All @@ -38,7 +38,7 @@ public function testReturnsExpectedScript(): void
],
];

$writer = new XDebugFilterScriptGenerator();
$writer = new XdebugFilterScriptGenerator;
$actual = $writer->generate($filterConfiguration);

$this->assertStringEqualsFile(__DIR__ . '/_files/expectedXDebugFilterScript.txt', $actual);
Expand Down

0 comments on commit d278688

Please sign in to comment.