Skip to content

Commit 950fe0c

Browse files
committed
Multiplier: Add missing param typehint to getValues
This fixes the following PHPStan errors: 280 Method Contributte\FormMultiplier\Multiplier::getValues() has parameter $returnType with no type specified. 290 No error to ignore is reported on line 290. (cherry picked from commit 42e1ced) We are not cherry-picking the nette/forms bump. Fix coding style (cherry picked from commit f7ebe4d)
1 parent f2eae87 commit 950fe0c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Multiplier.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,11 +272,11 @@ public function resetFormEvents(): void
272272
}
273273

274274
/**
275+
* @param string|object|bool|null $returnType 'array' for array
275276
* @param Control[]|null $controls
276277
* @return object|mixed[]
277-
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingAnyTypeHint
278278
*/
279-
public function getValues($returnType = null, ?array $controls = null): object|array
279+
public function getValues(string|object|bool|null $returnType = null, ?array $controls = null): object|array
280280
{
281281
if (!$this->resetKeys) {
282282
return parent::getValues($returnType, $controls);
@@ -286,7 +286,7 @@ public function getValues($returnType = null, ?array $controls = null): object|a
286286
$values = parent::getValues('array', $controls);
287287
$values = array_values($values);
288288

289-
$returnType = $returnType === true ? 'array' : $returnType; // @phpstan-ignore-line nette backwards compatibility
289+
$returnType = $returnType === true ? 'array' : $returnType;
290290

291291
return $returnType === 'array' ? $values : ArrayHash::from($values);
292292
}

0 commit comments

Comments
 (0)