dg / dibi

Dibi - smart database abstraction layer
https://dibiphp.com
Other
487 stars 136 forks source link

Support for and() in \Dibi\Fluent #298

Closed integer closed 6 years ago

integer commented 6 years ago

I checking some codebase using Dibi with PHPStan. PHPStan gives me errors like this Call to an undefined method Dibi\Fluent::and().

It is because some colleagues uses constructions like $fluent->where('columnA = 1')->and('columnB = 2');. Dibi\Fluent understand this syntax and produce as same query as for $fluent->where('columnA = 1 AND columnB = 2');. Problem is in missing class @method annotation for and(...$cond) function. Would it be possible to add annotation for this method?

Same issue is in $fluent->join('tableA a')->on('a.columnA = b.id')->and('a.columnB = 2');

UPDATE: I found usage methods Dibi\Fluent::desc() and Dibi\Fluent::asc() too.

dg commented 6 years ago

Can you send pull request?