X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fpq%2FQuery%2FExecutor.php;fp=lib%2Fpq%2FQuery%2FExecutor.php;h=3b97a6f2e6984f766efb03bd8db9ac1eabb2c0c2;hb=5c080bb03b5fee867da94cb3c1108d59529f741a;hp=e0bb169f3d191ad8a68fdd48e62472e72a12d294;hpb=0a6fac6b260383a6abea76804410273c7b8b630b;p=m6w6%2Fpq-gateway diff --git a/lib/pq/Query/Executor.php b/lib/pq/Query/Executor.php index e0bb169..3b97a6f 100644 --- a/lib/pq/Query/Executor.php +++ b/lib/pq/Query/Executor.php @@ -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; } /**