Skip to content

Commit 41f1b10

Browse files
committed
fix styleci issues
1 parent dd00af2 commit 41f1b10

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

src/PhpunitMerger/Command/LogCommand.php

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class LogCommand extends Command
2222
*/
2323
private $domElements = [];
2424

25-
private $keysToCalculate = ["assertions", "time", "tests", "errors", "failures", "skipped"];
25+
private $keysToCalculate = ['assertions', 'time', 'tests', 'errors', 'failures', 'skipped'];
2626

2727
protected function configure()
2828
{
@@ -51,15 +51,15 @@ protected function execute(InputInterface $input, OutputInterface $output)
5151

5252
$root = $this->document->createElement('testsuites');
5353
$baseSuite = $this->document->createElement('testsuite');
54-
$baseSuite->setAttribute('name', "All Suites");
55-
$baseSuite->setAttribute('tests', "0");
56-
$baseSuite->setAttribute('assertions', "0");
57-
$baseSuite->setAttribute('errors', "0");
58-
$baseSuite->setAttribute('failures', "0");
59-
$baseSuite->setAttribute('skipped', "0");
60-
$baseSuite->setAttribute('time', "0");
54+
$baseSuite->setAttribute('name', 'All Suites');
55+
$baseSuite->setAttribute('tests', '0');
56+
$baseSuite->setAttribute('assertions', '0');
57+
$baseSuite->setAttribute('errors', '0');
58+
$baseSuite->setAttribute('failures', '0');
59+
$baseSuite->setAttribute('skipped', '0');
60+
$baseSuite->setAttribute('time', '0');
6161

62-
$this->domElements["All Suites"] = $baseSuite;
62+
$this->domElements['All Suites'] = $baseSuite;
6363

6464
$root->appendChild($baseSuite);
6565
$this->document->appendChild($root);
@@ -72,7 +72,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
7272
$this->addTestSuites($baseSuite, $xmlArray);
7373
}
7474
} catch (\Exception $exception) {
75-
$output->writeln(sprintf("<error>Error in file %s: %s</error>", $file->getRealPath(), $exception->getMessage()));
75+
$output->writeln(sprintf('<error>Error in file %s: %s</error>', $file->getRealPath(), $exception->getMessage()));
7676
}
7777
}
7878

@@ -153,7 +153,7 @@ private function addTestCases(\DOMElement $parent, array $testCases)
153153
private function addChildElements(array $tree, \DOMElement $element)
154154
{
155155
foreach ($tree as $key => $value) {
156-
if ($key == "@attributes") {
156+
if ($key == '@attributes') {
157157
continue;
158158
}
159159
$child = $this->document->createElement($key);
@@ -164,11 +164,13 @@ private function addChildElements(array $tree, \DOMElement $element)
164164
private function calculateTopLevelStats()
165165
{
166166
/** @var \DOMElement $topNode */
167-
$suites = $this->document->getElementsByTagName("testsuites")->item(0);
167+
$suites = $this->document->getElementsByTagName('testsuites')->item(0);
168168
$topNode = $suites->firstChild;
169169
if ($topNode->hasChildNodes()) {
170170
$stats = array_flip($this->keysToCalculate);
171-
$stats = array_map(function ($_value) { return 0; }, $stats);
171+
$stats = array_map(function ($_value) {
172+
return 0;
173+
}, $stats);
172174
foreach($topNode->childNodes as $child) {
173175
$attributes = $child->attributes;
174176
foreach ($attributes as $key => $value) {

tests/PhpunitMerger/Command/AbstractCommandTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ abstract class AbstractCommandTest extends TestCase
2222
public function assertOutputFileNotExists()
2323
{
2424
$filesystem = new Filesystem();
25-
self::assertDirectoryExists($this->logDirectory , $this->logDirectory . " does not exists");
25+
self::assertDirectoryExists($this->logDirectory , $this->logDirectory . ' does not exists');
2626
$filesystem->remove($this->logDirectory . $this->outputFile);
2727

2828
$this->assertFileNotExists($this->logDirectory . $this->outputFile);
2929
}
3030

3131
public function assertOutputDirectoryNotExists()
3232
{
33-
self::assertDirectoryExists($this->logDirectory , $this->logDirectory . " does not exists");
33+
self::assertDirectoryExists($this->logDirectory , $this->logDirectory . ' does not exists');
3434
$filesystem = new Filesystem();
3535
$filesystem->remove($this->logDirectory . dirname($this->outputFile));
3636

0 commit comments

Comments
 (0)