Use function is_object()
This commit is contained in:
@ -36,7 +36,7 @@ class Db
|
|||||||
{
|
{
|
||||||
if (!isset(self::$connections[$name])) {
|
if (!isset(self::$connections[$name])) {
|
||||||
if (!$config) {
|
if (!$config) {
|
||||||
if (gettype(Config::get(__CLASS__)) != 'object') {
|
if (!is_object(Config::get(__CLASS__))) {
|
||||||
throw new InitializationException('Trying to get property of non-object');
|
throw new InitializationException('Trying to get property of non-object');
|
||||||
}
|
}
|
||||||
$config = Config::get(__CLASS__)->$name;
|
$config = Config::get(__CLASS__)->$name;
|
||||||
|
@ -31,8 +31,7 @@ class RedisManager
|
|||||||
{
|
{
|
||||||
if (!isset(self::$connections[$name])) {
|
if (!isset(self::$connections[$name])) {
|
||||||
if (!$config) {
|
if (!$config) {
|
||||||
|
if (!is_object(Config::get('Redis'))) {
|
||||||
if (gettype(Config::get('Redis')) != 'object') {
|
|
||||||
throw new GeneralException('Redis config no existence');
|
throw new GeneralException('Redis config no existence');
|
||||||
}
|
}
|
||||||
$config = Config::get('Redis')->$name;
|
$config = Config::get('Redis')->$name;
|
||||||
|
Reference in New Issue
Block a user