Skip to content

Commit

Permalink
PHPStan fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinMystikJonas committed Apr 11, 2024
1 parent 79afcf9 commit 197d047
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ includes:
parameters:
excludePaths:
- tests/*/data/*
ignoreErrors:
-
message: '#Instanceof between Nette\\Application\\IPresenterFactory and Nette\\Application\\IPresenterFactory will always evaluate to true#'
path: '*/Nette/PresenterResolver.php'
reportUnmatched: false
count: 1
2 changes: 1 addition & 1 deletion src/Nette/PresenterResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected function getPresenterFactory(): IPresenterFactory
$presenterFactory->setMapping($this->mapping);
} elseif ($this->containerResolver->getContainer() !== null) {
$presenterFactory = $this->containerResolver->getContainer()->getByType(IPresenterFactory::class);
if (!$presenterFactory instanceof IPresenterFactory) { /** @phpstan-ignore-line */
if (!$presenterFactory instanceof IPresenterFactory) {
throw new ShouldNotHappenException('Invalid type of IPresenterFactory from container');
}
} else {
Expand Down

0 comments on commit 197d047

Please sign in to comment.