Skip to content

changed LambdaFilter/LambdaTokenizer phpdoc param from function to callable #70

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from May 2, 2021
Merged

Conversation

ghost
Copy link

@ghost ghost commented Apr 29, 2021

Hello, I am using your library for some time and I think it is great!
But, every time I pass a callable in LambdaFilter, psalm and phpstorm arguing at me that I'm using an invalid argument like this:

ERROR: InvalidArgument - scripts/Namespace/VO/SomeVO.php:42:52 - Argument 1 of TextAnalysis\Filters\LambdaFilter::__construct expects TextAnalysis\Filters\function, pure-Closure(mixed):(null|string) provided (see https://psalm.dev/004) ->applyTransformation(new LambdaFilter(static function (string $word) { return preg_replace(self::AVAILABLE_CHARACTERS_REGEXP, '', $word); }));

Maybe it would be better to have callable phpdoc, because it doesn't lead to any errors?

@yooper yooper merged commit 9ddbc75 into yooper:master May 2, 2021
@yooper
Copy link
Owner

yooper commented May 2, 2021

@Novemb3r , thank you for the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant