Skip to content

Commit cf13570

Browse files
theseersebastianbergmann
authored andcommitted
Fix formatting :)
1 parent b47175d commit cf13570

File tree

2 files changed

+20
-9
lines changed

2 files changed

+20
-9
lines changed

src/TextUI/XmlConfiguration/Migration/Migrations/MoveWhitelistExcludesToCoverage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public function migrate(DOMDocument $document): void
3030
}
3131

3232
$excludeNodes = SnapshotNodeList::fromNodeList($whitelist->getElementsByTagName('exclude'));
33+
3334
if ($excludeNodes->count() === 0) {
3435
return;
3536
}
@@ -51,7 +52,6 @@ public function migrate(DOMDocument $document): void
5152
foreach ($excludeNodes as $excludeNode) {
5253
assert($excludeNode instanceof DOMElement);
5354

54-
5555
foreach (SnapshotNodeList::fromNodeList($excludeNode->childNodes) as $child) {
5656
if (!$child instanceof DOMElement || !in_array($child->nodeName, ['directory', 'file'], true)) {
5757
continue;
Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
<?php declare(strict_types = 1);
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+
*/
210
namespace TextUI\XmlConfiguration\Migration;
311

412
use ArrayIterator;
@@ -7,26 +15,29 @@
715
use DOMNodeList;
816
use IteratorAggregate;
917

10-
class SnapshotNodeList implements IteratorAggregate, Countable {
11-
18+
class SnapshotNodeList implements Countable, IteratorAggregate
19+
{
1220
/** @var DOMNode[] */
1321
private $nodes = [];
1422

15-
public static function fromNodeList(DOMNodeList $list): SnapshotNodeList {
23+
public static function fromNodeList(DOMNodeList $list): self
24+
{
1625
$snapshot = new self();
17-
foreach($list as $node) {
26+
27+
foreach ($list as $node) {
1828
$snapshot->nodes[] = $node;
1929
}
2030

2131
return $snapshot;
2232
}
2333

24-
public function count(): int {
34+
public function count(): int
35+
{
2536
return count($this->nodes);
2637
}
2738

28-
public function getIterator() {
39+
public function getIterator()
40+
{
2941
return new ArrayIterator($this->nodes);
3042
}
31-
3243
}

0 commit comments

Comments
 (0)