Skip to content

Commit 15527e5

Browse files
committed
Fix PHPStan issue with nette/component-model 3.1.0
nette/component-model 3.1.0 made the type annotations more precise, correctly declaring that `null` will not be returned when `$throw` argument is `true` (default): nette/component-model@fbab7bc As a result PHPStan started to complain: Expression on left side of ?? is not nullable. (cherry picked from commit 7445d0d, 2afcd08)
1 parent 950fe0c commit 15527e5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Multiplier.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Nette\Forms\Controls\BaseControl;
1212
use Nette\Forms\Controls\SubmitButton;
1313
use Nette\Forms\Form;
14+
use Nette\InvalidStateException;
1415
use Nette\Utils\ArrayHash;
1516
use Nette\Utils\Arrays;
1617
use Traversable;
@@ -399,10 +400,11 @@ protected function fillContainer(Container $container): void
399400

400401
/**
401402
* @return string[]
403+
* @throws InvalidStateException when not attached.
402404
*/
403405
protected function getHtmlName(): array
404406
{
405-
return explode('-', $this->lookupPath(Form::class) ?? '');
407+
return explode('-', $this->lookupPath(Form::class));
406408
}
407409

408410
protected function createContainer(): Container

0 commit comments

Comments
 (0)