From 5a587d16f0b70d01b42bbb6d40a1528a50bb6eaa Mon Sep 17 00:00:00 2001 From: Gevik Babakhani Date: Thu, 6 Jun 2013 16:29:17 +0200 Subject: [PATCH] Fixed several formatting issues. Refactored == null to is_null == '' to empty(...) --- framework/yii/db/pgsql/PDO.php | 9 +++++---- framework/yii/db/pgsql/QueryBuilder.php | 3 ++- framework/yii/db/pgsql/Schema.php | 3 ++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/framework/yii/db/pgsql/PDO.php b/framework/yii/db/pgsql/PDO.php index 67387dd..3f5996a 100644 --- a/framework/yii/db/pgsql/PDO.php +++ b/framework/yii/db/pgsql/PDO.php @@ -16,13 +16,14 @@ namespace yii\db\pgsql; * @author Gevik babakhani * @since 2.0 */ -class PDO extends \PDO { +class PDO extends \PDO +{ const OPT_SEARCH_PATH = 'search_path'; const OPT_DEFAULT_SCHEMA = 'default_schema'; const DEFAULT_SCHEMA = 'public'; - private $_currentDatabase = null; + private $_currentDatabase; /** * Returns value of the last inserted ID. @@ -53,11 +54,11 @@ class PDO extends \PDO { } if (isset($options[self::OPT_DEFAULT_SCHEMA])) { $schema = trim($options[self::OPT_DEFAULT_SCHEMA]); - if ($schema !== '') { + if (!empty($schema)) { Schema::$DEFAULT_SCHEMA = $schema; } } - if (Schema::$DEFAULT_SCHEMA === null || Schema::$DEFAULT_SCHEMA === '') { + if (is_null(Schema::$DEFAULT_SCHEMA) || empty(Schema::$DEFAULT_SCHEMA)) { Schema::$DEFAULT_SCHEMA = self::DEFAULT_SCHEMA; } } diff --git a/framework/yii/db/pgsql/QueryBuilder.php b/framework/yii/db/pgsql/QueryBuilder.php index 0cd9d94..f45c753 100644 --- a/framework/yii/db/pgsql/QueryBuilder.php +++ b/framework/yii/db/pgsql/QueryBuilder.php @@ -14,7 +14,8 @@ namespace yii\db\pgsql; * @author Gevik Babakhani * @since 2.0 */ -class QueryBuilder extends \yii\db\QueryBuilder { +class QueryBuilder extends \yii\db\QueryBuilder +{ /** * @var array mapping from abstract column types (keys) to physical column types (values). diff --git a/framework/yii/db/pgsql/Schema.php b/framework/yii/db/pgsql/Schema.php index 1e19383..07238c4 100644 --- a/framework/yii/db/pgsql/Schema.php +++ b/framework/yii/db/pgsql/Schema.php @@ -18,7 +18,8 @@ use yii\db\ColumnSchema; * @author Gevik Babakhani * @since 2.0 */ -class Schema extends \yii\db\Schema { +class Schema extends \yii\db\Schema +{ /** * The default schema used for the current session. This value is