storage test
[m6w6/pq-gateway] / lib / pq / Query / Executor.php
index e0bb169f3d191ad8a68fdd48e62472e72a12d294..3b97a6f2e6984f766efb03bd8db9ac1eabb2c0c2 100644 (file)
@@ -76,13 +76,13 @@ class Executor implements ExecutorInterface
         * @param callable $callback
         * @return mixed
         */
-       function execute(WriterInterface $query, callable $callback) {
+       function execute(WriterInterface $query, callable $callback = null) {
                $this->result = null;
                $this->query = $query;
                $this->notify();
                $this->result = $this->getConnection()->execParams($query, $query->getParams(), $query->getTypes());
                $this->notify();
-               return $callback($this->result);
+               return $callback ? $callback($this->result) : $this->result;
        }
        
        /**