stellarwp / db

A WPDB wrapper and query builder library.
GNU General Public License v2.0
63 stars 6 forks source link

Fix WhereClause::whereExists() and WhereClause::whereNotExists() PHPDoc #13

Closed nikolaystrikhar closed 1 year ago

nikolaystrikhar commented 1 year ago

PHPStan throws Call to an undefined method ::limit() when you do something like this. I checked and all builder methods there return $this, so I just did the same for these 2 methods.

DB::table( 'posts' )
    ->select( 'ID' )
    ->whereNotExists(
        function ( QueryBuilder $builder ) {
            // whatever.
        }
    )
    ->limit( 1 );
nikolaystrikhar commented 1 year ago

@estevao90 pinged me about it, so adding him to a conversation just in case :-)

borkweb commented 1 year ago

Released as 1.0.5!