chore: improves type checking

This commit is contained in:
Nuno Maduro
2023-08-21 09:39:55 +01:00
parent 2dc413cba0
commit 6d9c0483a6
5 changed files with 14 additions and 5 deletions

View File

@ -22,7 +22,7 @@
"nunomaduro/collision": "^7.8.1",
"nunomaduro/termwind": "^1.15.1",
"pestphp/pest-plugin": "^2.0.1",
"pestphp/pest-plugin-arch": "^2.2.3",
"pestphp/pest-plugin-arch": "^2.3.1",
"phpunit/phpunit": "^10.3.2"
},
"conflict": {
@ -50,7 +50,7 @@
]
},
"require-dev": {
"pestphp/pest-dev-tools": "^2.15.0",
"pestphp/pest-dev-tools": "^2.16.0",
"pestphp/pest-plugin-type-coverage": "^2.0.0",
"symfony/process": "^6.3.2"
},

View File

@ -1,5 +1,6 @@
includes:
- vendor/phpstan/phpstan-strict-rules/rules.neon
- vendor/ergebnis/phpstan-rules/rules.neon
- vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon
parameters:
@ -11,4 +12,12 @@ parameters:
reportUnmatchedIgnoredErrors: true
ignoreErrors:
- "#has a nullable return type declaration.#"
- "#Language construct isset\\(\\) should not be used.#"
- "#is not allowed to extend#"
- "#is concrete, but does not have a Test suffix#"
- "#with a nullable type declaration#"
- "#type mixed is not subtype of native#"
- "# with null as default value#"
- "#has parameter \\$closure with default value.#"
- "#has parameter \\$description with default value.#"

View File

@ -20,7 +20,7 @@ abstract class Attribute
* @param array<int, string> $attributes
* @return array<int, string>
*/
public function __invoke(TestCaseMethodFactory $method, array $attributes): array
public function __invoke(TestCaseMethodFactory $method, array $attributes): array // @phpstan-ignore-line
{
return $attributes;
}

View File

@ -193,7 +193,7 @@ final class TestCaseFactory
}
PHP;
eval($classCode);
eval($classCode); // @phpstan-ignore-line
} catch (ParseError $caught) {
throw new RuntimeException(sprintf(
"Unable to create test case for test file at %s. \n %s",

View File

@ -40,7 +40,7 @@ final class KernelDump
*/
public function disable(): void
{
@ob_clean();
@ob_clean(); // @phpstan-ignore-line
if ($this->buffer !== '') {
$this->flush();