diff --git a/src/Dibi/Drivers/MySqlDriver.php b/src/Dibi/Drivers/MySqlDriver.php index accefe2f..d8b235f3 100644 --- a/src/Dibi/Drivers/MySqlDriver.php +++ b/src/Dibi/Drivers/MySqlDriver.php @@ -285,7 +285,7 @@ class MySqlDriver implements Dibi\Driver, Dibi\ResultDriver public function escapeText($value) { if (!is_resource($this->connection)) { - throw new DibiException('Lost connection to server.'); + throw new Dibi\Exception('Lost connection to server.'); } return "'" . mysql_real_escape_string($value, $this->connection) . "'"; } @@ -294,7 +294,7 @@ class MySqlDriver implements Dibi\Driver, Dibi\ResultDriver public function escapeBinary($value) { if (!is_resource($this->connection)) { - throw new DibiException('Lost connection to server.'); + throw new Dibi\Exception('Lost connection to server.'); } return "_binary'" . mysql_real_escape_string($value, $this->connection) . "'"; } diff --git a/src/Dibi/Drivers/PostgreDriver.php b/src/Dibi/Drivers/PostgreDriver.php index fec191d0..84d5663f 100644 --- a/src/Dibi/Drivers/PostgreDriver.php +++ b/src/Dibi/Drivers/PostgreDriver.php @@ -298,7 +298,7 @@ class PostgreDriver implements Dibi\Driver, Dibi\ResultDriver, Dibi\Reflector public function escapeText($value) { if (!is_resource($this->connection)) { - throw new DibiException('Lost connection to server.'); + throw new Dibi\Exception('Lost connection to server.'); } return "'" . pg_escape_string($this->connection, $value) . "'"; } @@ -307,7 +307,7 @@ class PostgreDriver implements Dibi\Driver, Dibi\ResultDriver, Dibi\Reflector public function escapeBinary($value) { if (!is_resource($this->connection)) { - throw new DibiException('Lost connection to server.'); + throw new Dibi\Exception('Lost connection to server.'); } return "'" . pg_escape_bytea($this->connection, $value) . "'"; } diff --git a/src/Dibi/Helpers.php b/src/Dibi/Helpers.php index a9f11be3..43fbf9ec 100644 --- a/src/Dibi/Helpers.php +++ b/src/Dibi/Helpers.php @@ -154,7 +154,7 @@ class Helpers /** @internal */ - public static function escape($driver, $value, $type) + public static function escape(Driver $driver, $value, $type) { static $types = [ Type::TEXT => 'text', @@ -167,7 +167,7 @@ class Helpers if (isset($types[$type])) { return $driver->{'escape' . $types[$type]}($value); } else { - throw new InvalidArgumentException('Unsupported type.'); + throw new \InvalidArgumentException('Unsupported type.'); } } diff --git a/src/Dibi/Translator.php b/src/Dibi/Translator.php index 4837d879..e4137bde 100644 --- a/src/Dibi/Translator.php +++ b/src/Dibi/Translator.php @@ -598,7 +598,7 @@ final class Translator return $matches[9] == '' ? $this->formatValue($m, FALSE) : $m . $matches[9]; // value or identifier } - die('this should be never executed'); + throw new \Exception('this should be never executed'); }