:octocat: run phpstan on the benchmarks

This commit is contained in:
smiley
2024-07-21 22:18:18 +02:00
parent 1617ed0168
commit e6b1ff0ada
5 changed files with 54 additions and 7 deletions
-1
View File
@@ -48,7 +48,6 @@ final class QRDataBenchmark extends BenchmarkAbstract{
#[Subject]
#[BeforeMethods(['assignParams', 'generateTestData', 'initOptions'])]
public function invocation():void{
/** @phan-suppress-next-line PhanNoopNew */
new QRData($this->options, [new $this->modeFQCN($this->testData)]);
}
-2
View File
@@ -6,8 +6,6 @@
* @author smiley <smiley@chillerlan.net>
* @copyright 2024 smiley
* @license MIT
*
* @phan-file-suppress PhanTypeArraySuspiciousNullable
*/
declare(strict_types=1);
+8 -4
View File
@@ -6,8 +6,6 @@
* @author smiley <smiley@chillerlan.net>
* @copyright 2024 smiley
* @license MIT
*
* @phan-file-suppress PhanTypeArraySuspiciousNullable
*/
declare(strict_types=1);
@@ -30,10 +28,16 @@ use function strtolower;
require_once __DIR__.'/parse-common.php';
if(!file_exists(FILE.'.json')){
throw new RuntimeException('invalid benchmark report');
throw new RuntimeException('invalid benchmark report [file_exists()]');
}
$json = json_decode(file_get_contents(FILE.'.json'), true);
$data = file_get_contents(FILE.'.json');
if($data === false){
throw new RuntimeException('invalid benchmark report [file_get_contents()]');
}
$json = json_decode($data, true);
$markdown = [];
// General information/overview
+45
View File
@@ -1,5 +1,50 @@
parameters:
ignoreErrors:
-
message: "#^Property chillerlan\\\\QRCodeBenchmark\\\\DecoderBenchmark\\:\\:\\$imageBlob \\(string\\) does not accept GdImage\\|string\\.$#"
count: 1
path: benchmark/DecoderBenchmark.php
-
message: "#^Parameter \\#1 \\$segment of method chillerlan\\\\QRCode\\\\QRCode\\:\\:addSegment\\(\\) expects chillerlan\\\\QRCode\\\\Data\\\\QRDataModeInterface, object given\\.$#"
count: 1
path: benchmark/QRCodeBenchmark.php
-
message: "#^Parameter \\#2 \\$dataSegments of class chillerlan\\\\QRCode\\\\Data\\\\QRData constructor expects array\\<chillerlan\\\\QRCode\\\\Data\\\\QRDataModeInterface\\>, array\\<int, object\\> given\\.$#"
count: 2
path: benchmark/QRDataBenchmark.php
-
message: "#^Parameter \\#1 \\$string of function strtolower expects string, int\\|string given\\.$#"
count: 1
path: benchmark/generate-markdown.php
-
message: "#^Offset 'name' does not exist on array\\<int, mixed\\>\\.$#"
count: 1
path: benchmark/parse-common.php
-
message: "#^Offset 'results' does not exist on array\\<int, mixed\\>\\.$#"
count: 1
path: benchmark/parse-common.php
-
message: "#^Offset 0 does not exist on array\\{\\}\\.$#"
count: 1
path: benchmark/parse-common.php
-
message: "#^Function chillerlan\\\\QRCodeBenchmark\\\\parseLine\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
path: benchmark/parse-result.php
-
message: "#^Parameter \\#1 \\$string of function trim expects string, string\\|false given\\.$#"
count: 1
path: benchmark/parse-result.php
-
message: "#^Property chillerlan\\\\QRCode\\\\QROptions\\:\\:\\$eccLevel \\(int\\) does not accept string\\.$#"
count: 1
+1
View File
@@ -4,6 +4,7 @@ parameters:
level: 8
tmpDir: .build/phpstan-cache
paths:
- benchmark
- examples
- src
- tests