diff --git a/composer.json b/composer.json index b533ae7..732957e 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "nette/di": "^3.1.0", "latte/latte": "^3.0.0", "contributte/qa": "^0.3", - "contributte/phpstan": "^0.1", + "contributte/phpstan": "^0.2", "webchemistry/testing-helpers": "^4.0.0" }, "conflict": { diff --git a/phpstan.neon b/phpstan.neon index 2cc7d7c..5eda96f 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -16,3 +16,11 @@ parameters: paths: - src - .docs + + ignoreErrors: + # https://github.com/phpstan/phpstan-nette/issues/141 + - + message: '#^Parameter \#1 \$array of function array_filter expects array, Iterator\ given\.$#' + identifier: argument.type + count: 3 + path: src/Multiplier.php diff --git a/src/Multiplier.php b/src/Multiplier.php index 8cf4c12..2fe7c42 100644 --- a/src/Multiplier.php +++ b/src/Multiplier.php @@ -110,6 +110,9 @@ public static function register(string $name = 'addMultiplier'): void }); } + /** + * @return ($throw is true ? Form : ?Form) + */ public function getForm(bool $throw = true): ?Form { if ($this->form) { @@ -378,7 +381,7 @@ protected function isValidMaxCopies(): bool protected function isFormSubmitted(): bool { - return $this->getForm() !== null && $this->getForm()->isAnchored() && $this->getForm()->isSubmitted(); + return $this->getForm(false) !== null && $this->getForm()->isAnchored() && $this->getForm()->isSubmitted(); } protected function loadHttpData(): void