diff --git a/phpstan.neon b/phpstan.neon index 110a3f9..e6c2fa6 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -24,6 +24,9 @@ parameters: reportWrongPhpDocTypeInVarTag: true reportAnyTypeWideningInVarTag: true checkMissingOverrideMethodAttribute: true + ignoreErrors: + - "#^Parameter \\#1 \\$id \\(class\\-string\\\\) of method PrinsFrank\\\\Container\\\\Container\\:\\:get\\(\\) should be contravariant with parameter \\$id \\(string\\) of method Psr\\\\Container\\\\ContainerInterface\\:\\:get\\(\\)$#" + - "#^Parameter \\#1 \\$id \\(class\\-string\\\\) of method PrinsFrank\\\\Container\\\\Container\\:\\:has\\(\\) should be contravariant with parameter \\$id \\(string\\) of method Psr\\\\Container\\\\ContainerInterface\\:\\:has\\(\\)$#" includes: - phar://phpstan.phar/conf/bleedingEdge.neon - vendor/phpstan/phpstan-strict-rules/rules.neon diff --git a/src/Container.php b/src/Container.php index c490d06..a93a889 100644 --- a/src/Container.php +++ b/src/Container.php @@ -31,8 +31,6 @@ public function __construct(bool $allowSelfResolve = true, private readonly bool * @param class-string $id * @throws UnresolvableException|InvalidServiceProviderException|InvalidMethodException|MissingDefinitionException * @return T|null - * - * @phpstan-ignore method.childParameterType */ #[Override] public function get(string $id): ?object { @@ -60,11 +58,7 @@ public function get(string $id): ?object { throw new UnresolvableException(sprintf('Id "%s" is not resolvable', $id)); } - /** - * @param class-string $id - * - * @phpstan-ignore method.childParameterType - */ + /** @param class-string $id */ #[Override] public function has(string $id): bool { if ($this->autowire === true) {