From 18fbd7510a1f5c01ece1079f7346dc957812888e Mon Sep 17 00:00:00 2001 From: Alexander Mohorev Date: Sat, 2 Nov 2013 16:12:28 +0300 Subject: [PATCH] Missing return statement --- framework/yii/db/ActiveRecord.php | 2 ++ framework/yii/db/mssql/Schema.php | 2 ++ framework/yii/i18n/GettextMoFile.php | 2 ++ 3 files changed, 6 insertions(+) diff --git a/framework/yii/db/ActiveRecord.php b/framework/yii/db/ActiveRecord.php index 79d5146791..2c1689cdf0 100644 --- a/framework/yii/db/ActiveRecord.php +++ b/framework/yii/db/ActiveRecord.php @@ -1266,6 +1266,8 @@ class ActiveRecord extends Model $relation = $this->$getter(); if ($relation instanceof ActiveRelation) { return $relation; + } else { + return null; } } catch (UnknownMethodException $e) { throw new InvalidParamException(get_class($this) . ' has no relation named "' . $name . '".', 0, $e); diff --git a/framework/yii/db/mssql/Schema.php b/framework/yii/db/mssql/Schema.php index 0bb5924887..deb92f956f 100644 --- a/framework/yii/db/mssql/Schema.php +++ b/framework/yii/db/mssql/Schema.php @@ -118,6 +118,8 @@ class Schema extends \yii\db\Schema if ($this->findColumns($table)) { $this->findForeignKeys($table); return $table; + } else { + return null; } } diff --git a/framework/yii/i18n/GettextMoFile.php b/framework/yii/i18n/GettextMoFile.php index a92293c23f..4a0a93ca82 100644 --- a/framework/yii/i18n/GettextMoFile.php +++ b/framework/yii/i18n/GettextMoFile.php @@ -203,6 +203,8 @@ class GettextMoFile extends GettextFile { if ($byteCount > 0) { return fread($fileHandle, $byteCount); + } else { + return null; } }