From 16e50c3277e8d7284bccf4c9883af82d9fd83d16 Mon Sep 17 00:00:00 2001 From: Timothy J Warren Date: Wed, 24 Jan 2018 13:25:42 -0500 Subject: [PATCH] Fix some missed type hints --- src/Drivers/Pgsql/Driver.php | 2 +- src/QueryBuilder.php | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Drivers/Pgsql/Driver.php b/src/Drivers/Pgsql/Driver.php index 0c5d7e5..e3bbe51 100644 --- a/src/Drivers/Pgsql/Driver.php +++ b/src/Drivers/Pgsql/Driver.php @@ -30,7 +30,7 @@ class Driver extends AbstractDriver { * @param string $password * @param array $options */ - public function __construct($dsn, $username=NULL, $password=NULL, array $options=[]) + public function __construct(string $dsn, string $username=NULL, string $password=NULL, array $options=[]) { if (strpos($dsn, 'pgsql') === FALSE) { diff --git a/src/QueryBuilder.php b/src/QueryBuilder.php index 60631fb..38ed920 100644 --- a/src/QueryBuilder.php +++ b/src/QueryBuilder.php @@ -120,12 +120,9 @@ class QueryBuilder implements QueryBuilderInterface { */ public function __call(string $name, array $params) { - //foreach([$this, $this->driver] as $object) + if (method_exists($this->driver, $name)) { - if (method_exists($this->driver, $name)) - { - return \call_user_func_array([$this->driver, $name], $params); - } + return \call_user_func_array([$this->driver, $name], $params); } throw new BadMethodCallException('Method does not exist');