Skip to content

Commit

Permalink
Refactor CompileCommandTest and update PHPStan configurations
Browse files Browse the repository at this point in the history
Remove redundant assertions in CompileCommandTest for improved clarity and tweak PHPStan to allow ignorable banned code. Added new rules to PHPStan baseline for managing specific edge cases in code analysis.
  • Loading branch information
Spomky committed Dec 16, 2024
1 parent 0a8b2a4 commit cbe61fe
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 6 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,12 @@ parameters:
count: 1
path: src/ImageProcessor/GDImageProcessor.php

-
message: '#^Should not use node with type "Stmt_Echo", please change the code\.$#'
identifier: ekinoBannedCode.expression
count: 3
path: src/ImageProcessor/GDImageProcessor.php

-
message: '#^PHPDoc tag @return with type array\<string, string\> is incompatible with native type string\.$#'
identifier: return.phpDocType
Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ parameters:
- tests

banned_code:
non_ignorable: true
non_ignorable: false
checkUninitializedProperties: true
treatPhpDocTypesAsCertain: false
scanFiles:
Expand Down
4 changes: 1 addition & 3 deletions tests/Functional/CompileCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ public static function theFileAreCompiled(): void
static::assertFileExists(
self::$kernel->getCacheDir() . '/output/assets/pwa/screenshots/915x412-YUHoCJZ.svg'
);
static::assertFileExists(
self::$kernel->getCacheDir() . '/output/assets/pwa/1920x1920-hiy4m6N.svg'
);
static::assertFileExists(self::$kernel->getCacheDir() . '/output/assets/pwa/1920x1920-hiy4m6N.svg');
}
}

0 comments on commit cbe61fe

Please sign in to comment.