thephpleague / monga

Simple and swift MongoDB abstraction.
MIT License
331 stars 30 forks source link

Weird syntax for calling method #34

Closed ftassi closed 8 years ago

ftassi commented 8 years ago

I'm having hard time figuring out why this

public function andWhereNot($field, $value)
{
    return call_user_func_array([$this, 'whereNot'], func_get_args());
}

has been used instead of

public function andWhereNot($field, $value)
{
    return $this->whereNot($field, $value);
}

which would have been, imho, way more explicit and readable. Is there any particular reason? I'd be willing to refactor all the call_userfunc* usage to direct method calls (of course when it make sense) if you guys will accept a PR for this.

bcrowe commented 8 years ago

Makes sense to me. Feel free to open up a PR.

bcrowe commented 8 years ago

Updated in https://github.com/thephpleague/monga/commit/dd4d5b4348a7289e47cc6d23c0500d51a06192aa