Skip to content

Commit 41cff65

Browse files
committed
TASK: Use types for validating input
1 parent 033cb65 commit 41cff65

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

Classes/EelHelper/SuggestionIndexHelper.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,9 @@ public function build($input, $weight = 1)
4343
* @return array
4444
* @throws Exception
4545
*/
46-
protected function prepareInput($input)
46+
protected function prepareInput($input): ?array
4747
{
48-
$process = static function ($input) {
49-
if (!\is_string($input)) {
50-
throw new Exception('Only string are supported as input', 1512733297);
51-
}
48+
$process = static function (string $input) {
5249
$input = preg_replace("/\r|\n/", '', $input);
5350
return array_values(array_filter(explode(' ', preg_replace("/[^[:alnum:][:space:]]/u", ' ', strip_tags($input)))));
5451
};

0 commit comments

Comments
 (0)