diff --git a/composer.json b/composer.json index 4a79ecd..da397d7 100644 --- a/composer.json +++ b/composer.json @@ -15,11 +15,11 @@ "require": { "php": ">=5.4.0", "vlucas/valitron": "~1.1", - "doctrine/dbal": "~2.4", + "doctrine/dbal": "2.5.4", "sabre/event": "~2.0" }, "require-dev": { - "phpunit/phpunit": "^4.7" + "phpunit/phpunit": "^4.8" }, "autoload": { "psr-4": { diff --git a/lib/Query.php b/lib/Query.php index 769de94..7fbfbdd 100644 --- a/lib/Query.php +++ b/lib/Query.php @@ -799,12 +799,8 @@ public function __call($method, $args) // Methods on Collection } elseif (method_exists('\\Spot\\Entity\\Collection', $method)) { - if(isset($args[0])){ - return $this->execute()->$method($args[0]); - } else { - return $this->execute()->$method(); - } - + return call_user_func_array($method, $args); + // Error } else { throw new \BadMethodCallException("Method '" . __CLASS__ . "::" . $method . "' not found");