Skip to content

Commit 167ef71

Browse files
committed
Get advantage of updated Nette typehints
1 parent ca651d6 commit 167ef71

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

src/AutocompleteInput/AutocompleteInput.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,7 @@ public function signalReceived(string $signal): void
6767

6868
private function getPresenter(): Presenter
6969
{
70-
$presenter = $this->lookup(Presenter::class, true);
71-
assert($presenter instanceof Presenter);
72-
return $presenter;
70+
return $this->lookup(Presenter::class, true);
7371
}
7472

7573
private function getUniqueId(): string

tests/PHPStan/conditional.config.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@
1414
];
1515
}
1616

17+
if (InstalledVersions::satisfies(new VersionParser(), 'nette/component-model', '<3.1.4')) {
18+
$config['parameters']['ignoreErrors'][] = [
19+
'message' => '#^Method Nepada\\\\AutocompleteInput\\\\AutocompleteInput\\:\\:getPresenter\\(\\) should return Nette\\\\Application\\\\UI\\\\Presenter but returns Nette\\\\ComponentModel\\\\IComponent\\.$#',
20+
'path' => __DIR__ . '/../../src/AutocompleteInput/AutocompleteInput.php',
21+
'count' => 1,
22+
];
23+
}
24+
25+
1726
if (! InstalledVersions::satisfies(new VersionParser(), 'nette/forms', '<=3.2.8')) {
1827
$config['parameters']['ignoreErrors'][] = [
1928
'message' => '~^Parameter \\#2 \\$callback of static method Nette\\\\Forms\\\\Container\\:\\:extensionMethod\\(\\) expects callable\\(Nette\\\\Forms\\\\Container\\)\\: mixed, Closure\\(Nette\\\\Forms\\\\Container, int\\|string, Nette\\\\Utils\\\\Html\\|string\\|null, callable, int\\|null\\=\\)\\: Nepada\\\\AutocompleteInput\\\\AutocompleteInput given\\.$~',

0 commit comments

Comments
 (0)