lexik / LexikFormFilterBundle

This Symfony bundle aim to provide classes to build some form filters and then build a doctrine query from this form filter.
MIT License
389 stars 119 forks source link

Condition $expression hint as string #305

Open zajca opened 5 years ago

zajca commented 5 years ago

In examples like https://github.com/lexik/LexikFormFilterBundle/blob/master/Resources/doc/working-with-the-bundle.md#ii-filter-customization user can see return $filterQuery->createCondition($expression, $parameters); where $expressing can be Composite but internally phpdoc hint is string. This will throw error in static analysis like Phpstan. I suggests that this should be changed to mixed or in documentation should be $expression cast to string return $filterQuery->createCondition((string)$expression, $parameters);

FabienSalles commented 3 years ago

Same problem here, I will disable the error on PHPStan but even my IDE complains.

Is there a reason to have a string type in this phpdoc ?