Skip to content

Commit

Permalink
Rector cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
michalsn committed Oct 15, 2020
1 parent cd01334 commit 92dfd03
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion system/Database/Sqlsrv/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

namespace CodeIgniter\Database\Sqlsrv;

use Closure;
use CodeIgniter\Database\BaseBuilder;
use CodeIgniter\Database\Exceptions\DatabaseException;
use CodeIgniter\Database\Exceptions\DataException;
Expand Down Expand Up @@ -623,7 +624,7 @@ protected function whereHaving(string $qbKey, $key, $value = null, string $type
$k .= " $op";
}

if ($v instanceof \Closure)
if ($v instanceof Closure)
{
$builder = $this->cleanClone();
$v = '(' . str_replace("\n", ' ', $v($builder)->getCompiledSelect()) . ')';
Expand Down
3 changes: 2 additions & 1 deletion system/Database/Sqlsrv/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
use CodeIgniter\Database\BaseConnection;
use CodeIgniter\Database\ConnectionInterface;
use CodeIgniter\Database\Exceptions\DatabaseException;
use Exception;
use stdClass;

/**
Expand Down Expand Up @@ -525,7 +526,7 @@ public function execute(string $sql)
log_message('error', $error['message']);
if ($this->DBDebug)
{
throw new \Exception($error['message']);
throw new Exception($error['message']);
}
}

Expand Down
7 changes: 4 additions & 3 deletions system/Database/Sqlsrv/PreparedQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@

namespace CodeIgniter\Database\Sqlsrv;

use BadMethodCallException;
use CodeIgniter\Database\PreparedQueryInterface;
use CodeIgniter\Database\BasePreparedQuery;
use Exception;

/**
* Prepared query for Postgre
Expand All @@ -63,7 +65,6 @@ class PreparedQuery extends BasePreparedQuery implements PreparedQueryInterface
protected $result;

//--------------------------------------------------------------------

/**
* Prepares the query against the database, and saves the connection
* info necessary to execute the query later.
Expand All @@ -75,7 +76,7 @@ class PreparedQuery extends BasePreparedQuery implements PreparedQueryInterface
* @param array $options Options takes an associative array;
*
* @return mixed
* @throws \Exception
* @throws Exception
*/
public function _prepare(string $sql, array $options = [])
{
Expand Down Expand Up @@ -109,7 +110,7 @@ public function _execute(array $data): bool
{
if (is_null($this->statement))
{
throw new \BadMethodCallException('You must call prepare before trying to execute a prepared statement.');
throw new BadMethodCallException('You must call prepare before trying to execute a prepared statement.');
}

foreach ($data as $key => $value)
Expand Down

0 comments on commit 92dfd03

Please sign in to comment.