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 Nov 16, 2022
1 parent bc1ff24 commit 2dfaeeb
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/RawCodeCoverageData.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@
use function array_intersect;
use function array_intersect_key;
use function count;
use function explode;
use function file_get_contents;
use function in_array;
use function is_file;
use function range;
use function trim;
use SebastianBergmann\CodeCoverage\Driver\Driver;
use SebastianBergmann\CodeCoverage\StaticAnalysis\FileAnalyser;

Expand Down
3 changes: 3 additions & 0 deletions src/Report/Cobertura.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@
*/
namespace SebastianBergmann\CodeCoverage\Report;

use function basename;
use function count;
use function dirname;
use function file_put_contents;
use function preg_match;
use function range;
use function str_replace;
use function time;
use DOMImplementation;
use SebastianBergmann\CodeCoverage\CodeCoverage;
Expand Down
5 changes: 5 additions & 0 deletions src/Report/Html/Renderer/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@
use const T_YIELD;
use const T_YIELD_FROM;
use function array_key_exists;
use function array_keys;
use function array_merge;
use function array_pop;
use function array_unique;
use function constant;
Expand All @@ -89,6 +91,9 @@
use function file_get_contents;
use function htmlspecialchars;
use function is_string;
use function ksort;
use function range;
use function sort;
use function sprintf;
use function str_replace;
use function substr;
Expand Down
2 changes: 1 addition & 1 deletion src/Report/Xml/Coverage.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function __construct(DOMElement $context, string $line)
{
$this->contextNode = $context;

$this->writer = new XMLWriter();
$this->writer = new XMLWriter;
$this->writer->openMemory();
$this->writer->startElementNS(null, $context->nodeName, 'https://schema.phpunit.de/coverage/1.0');
$this->writer->writeAttribute('nr', $line);
Expand Down
2 changes: 1 addition & 1 deletion src/Report/Xml/Report.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ final class Report extends File
{
public function __construct(string $name)
{
$dom = new DOMDocument();
$dom = new DOMDocument;
$dom->loadXML('<?xml version="1.0" ?><phpunit xmlns="https://schema.phpunit.de/coverage/1.0"><file /></phpunit>');

$contextNode = $dom->getElementsByTagNameNS(
Expand Down
2 changes: 1 addition & 1 deletion src/Report/Xml/Source.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function setSourceCode(string $source): void
{
$context = $this->context;

$tokens = (new Tokenizer())->parse($source);
$tokens = (new Tokenizer)->parse($source);
$srcDom = (new XMLSerializer(new NamespaceUri($context->namespaceURI)))->toDom($tokens);

$context->parentNode->replaceChild(
Expand Down
1 change: 1 addition & 0 deletions src/StaticAnalysis/CachingFileAnalyser.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use function is_file;
use function md5;
use function serialize;
use function unserialize;
use SebastianBergmann\CodeCoverage\Util\Filesystem;
use SebastianBergmann\FileIterator\Facade as FileIteratorFacade;

Expand Down
1 change: 1 addition & 0 deletions src/StaticAnalysis/CodeUnitFindingVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/
namespace SebastianBergmann\CodeCoverage\StaticAnalysis;

use function assert;
use function implode;
use function rtrim;
use function trim;
Expand Down
3 changes: 3 additions & 0 deletions src/StaticAnalysis/ExecutableLinesFindingVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
*/
namespace SebastianBergmann\CodeCoverage\StaticAnalysis;

use function array_reverse;
use function range;
use function sort;
use PhpParser\Node;
use PhpParser\Node\Expr\Array_;
use PhpParser\Node\Expr\ArrayDimFetch;
Expand Down
2 changes: 2 additions & 0 deletions src/StaticAnalysis/ParsingFileAnalyser.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@
*/
namespace SebastianBergmann\CodeCoverage\StaticAnalysis;

use function array_merge;
use function array_unique;
use function assert;
use function file_get_contents;
use function is_array;
use function max;
use function sort;
use function sprintf;
use function substr_count;
use function token_get_all;
Expand Down
1 change: 1 addition & 0 deletions tests/tests/CodeCoverageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/
namespace SebastianBergmann\CodeCoverage;

use function array_fill;
use SebastianBergmann\CodeCoverage\Driver\Driver;
use SebastianBergmann\CodeCoverage\Driver\Selector;
use SebastianBergmann\Environment\Runtime;
Expand Down
2 changes: 1 addition & 1 deletion tests/tests/Data/ProcessedCodeCoverageDataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function testMergeWithPathCoverage(): void

public function testMergeWithPathCoverageIntoEmpty(): void
{
$coverage = new ProcessedCodeCoverageData();
$coverage = new ProcessedCodeCoverageData;

$coverage->merge($this->getPathCoverageForBankAccount()->getData());

Expand Down
1 change: 1 addition & 0 deletions tests/tests/StaticAnalysis/CodeUnitFindingVisitorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/
namespace SebastianBergmann\CodeCoverage\StaticAnalysis;

use function assert;
use function file_get_contents;
use PhpParser\NodeTraverser;
use PhpParser\NodeVisitor\NameResolver;
Expand Down

0 comments on commit 2dfaeeb

Please sign in to comment.