Skip to content

Commit 80ce9b3

Browse files
authored
fix super minor nitpicks (#77)
* fix super minor nitpicks * Fully update PHPUnit to latest 9.x
1 parent ed98718 commit 80ce9b3

File tree

7 files changed

+30
-27
lines changed

7 files changed

+30
-27
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"phploc/phploc": "*",
3131
"phpmd/phpmd": "1.5.*||~2.6",
3232
"phpstan/phpstan": "^0.12.5",
33-
"phpunit/phpunit": "~8.4||^9.0",
33+
"phpunit/phpunit": "^9.5",
3434
"sebastian/phpcpd": "*"
3535
},
3636
"autoload": {

phpunit.xml.dist

+14-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
32
<phpunit backupGlobals="false"
43
backupStaticAttributes="false"
54
colors="true"
@@ -9,26 +8,30 @@
98
processIsolation="false"
109
stopOnFailure="false"
1110
bootstrap="./vendor/autoload.php"
11+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
12+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
1213
>
1314
<testsuites>
1415
<testsuite name="PHP_CodeBrowser">
1516
<directory>./src/PHPCodeBrowser/Tests</directory>
1617
</testsuite>
1718
</testsuites>
1819

19-
<filter>
20-
<whitelist>
20+
<coverage>
21+
<include>
2122
<directory>./src</directory>
22-
<exclude>
23-
<directory>./src/PHPCodeBrowser/Tests</directory>
24-
</exclude>
25-
</whitelist>
26-
</filter>
23+
</include>
24+
<exclude>
25+
<directory>./src/PHPCodeBrowser/Tests</directory>
26+
</exclude>
27+
<report>
28+
<clover outputFile="build/logs/clover.xml"/>
29+
</report>
30+
</coverage>
2731

2832
<logging>
29-
<!--<log type="coverage-html" target="build/coverage" lowUpperBound="35" highLowerBound="70"/>-->
30-
<log type="coverage-clover" target="build/logs/clover.xml"/>
31-
<log type="junit" target="build/logs/junit.xml"/>
33+
<!--<log type="coverage-html" target="build/coverage" lowUpperBound="35" highLowerBound="70"/>-->
34+
<junit outputFile="build/logs/junit.xml"/>
3235
</logging>
3336

3437
<php>

src/PHPCodeBrowser/IssueXML.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,10 @@ public function addXMLFile(DOMDocument $domDocument): void
178178
*
179179
* @see DOMXPath::query
180180
*
181-
* @param string $expression Xpath expression to query for.
182-
* @param DOMNode $contextNode Node to use as context (optional)
181+
* @param string $expression Xpath expression to query for.
182+
* @param DOMNode|null $contextNode Node to use as context (optional)
183183
*
184-
* @return DOMNodeList List of all matching nodes.
184+
* @return DOMNodeList List of all matching nodes.
185185
*/
186186
public function query(string $expression, ?DOMNode $contextNode = null): DOMNodeList
187187
{

src/PHPCodeBrowser/SourceHandler.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public function addPlugin(AbstractPlugin $plugin): void
131131
/**
132132
* Add source files to the list.
133133
*
134-
* @param array<SplFileInfo>|array<string>|\AppendIterator $files The files to add
134+
* @param array<SplFileInfo|string>|\AppendIterator $files The files to add
135135
*/
136136
public function addSourceFiles($files): void
137137
{

src/PHPCodeBrowser/Tests/CLIControllerTest.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ public function testRunCleansExistingOutputDir(): void
147147
$this->controller->run();
148148

149149
$this->assertOutputIsPresent();
150-
$this->assertDirectoryNotExists(self::$testOutputDir.'/clear-directory');
151-
$this->assertFileNotExists(self::$testOutputDir.'/clear-file');
150+
$this->assertDirectoryDoesNotExist(self::$testOutputDir.'/clear-directory');
151+
$this->assertFileDoesNotExist(self::$testOutputDir.'/clear-file');
152152
}
153153

154154
/**
@@ -184,10 +184,10 @@ public function testRunExcludingAllSources(): void
184184
$this->controller->run();
185185

186186
$this->assertFileExists(self::$testOutputDir.'/index.html');
187-
$this->assertFileNotExists(self::$testOutputDir.'/Bad.php.html');
188-
$this->assertFileNotExists(self::$testOutputDir.'/Good.php.html');
189-
$this->assertDirectoryNotExists(self::$testOutputDir.'/css');
190-
$this->assertDirectoryNotExists(self::$testOutputDir.'/img');
191-
$this->assertDirectoryNotExists(self::$testOutputDir.'/js');
187+
$this->assertFileDoesNotExist(self::$testOutputDir.'/Bad.php.html');
188+
$this->assertFileDoesNotExist(self::$testOutputDir.'/Good.php.html');
189+
$this->assertDirectoryDoesNotExist(self::$testOutputDir.'/css');
190+
$this->assertDirectoryDoesNotExist(self::$testOutputDir.'/img');
191+
$this->assertDirectoryDoesNotExist(self::$testOutputDir.'/js');
192192
}
193193
}

src/PHPCodeBrowser/Tests/Helper/IOHelperTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public function testFileDeletion(): void
155155
}
156156

157157
$this->ioHelper->deleteFile($filename);
158-
$this->assertFileNotExists($filename);
158+
$this->assertFileDoesNotExist($filename);
159159
}
160160

161161
/**
@@ -174,7 +174,7 @@ public function testDirectoryDeletion(): void
174174
\touch($file);
175175

176176
$this->ioHelper->deleteDirectory($dir);
177-
$this->assertFileNotExists($dir);
177+
$this->assertFileDoesNotExist($dir);
178178
}
179179

180180
/**

src/PHPCodeBrowser/View/ViewReview.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,8 @@ private function formatSourceCode(string $filename, array $outputIssues): string
337337

338338
foreach ($lines as $line) {
339339
/**
340-
* @var DOMElement $line
341-
*/
340+
* @var DOMElement $line
341+
*/
342342
$line = $line;
343343
++$lineNumber;
344344
$line->setAttribute('id', 'line_'.$lineNumber);

0 commit comments

Comments
 (0)