rectorphp/rector-doctrine

New rule for "Passing an array for the first argument to QueryBuilder::select() is deprecated"

rpkamp opened this issue ยท 6 comments

rpkamp commented

We're getting the following deprecation warnings from Doctrine DBAL:

Passing an array for the first argument to QueryBuilder::select() is deprecated, pass each value as an individual variadic argument instead.

So for example

$queryBuilder->select(['field1', 'field2', 'field3', 'etc']);

should become

$queryBuilder->select('field1', 'field2', 'field3', 'etc');

@samsonasik Hi Abdul, could you cover this with new rule or close it?

@TomasVotruba I will try,

@rpkamp what doctrine specific version that start deprecating it?

@samsonasik I think the first version is doctrine/dbal 2.11 - doctrine/dbal#3853, doctrine/dbal#3837

Ok ๐Ÿ‘

I created PR

for it .

rpkamp commented

Thanks @samsonasik !