浏览代码

Improve code readability.

ADmad 7 年之前
父节点
当前提交
813cd75f15
共有 1 个文件被更改,包括 17 次插入17 次删除
  1. 17 17
      src/Controller/Controller.php

+ 17 - 17
src/Controller/Controller.php

@@ -370,24 +370,24 @@ class Controller implements EventListenerInterface, EventDispatcherInterface
         }
 
         list($plugin, $class) = pluginSplit($this->modelClass, true);
-        if ($class !== $name) {
-            $trace = debug_backtrace();
-            $parts = explode('\\', get_class($this));
-            trigger_error(
-                sprintf(
-                    'Undefined property: %s::$%s in %s on line %s',
-                    array_pop($parts),
-                    $name,
-                    $trace[0]['file'],
-                    $trace[0]['line']
-                ),
-                E_USER_NOTICE
-            );
-
-            return false;
-        }
+        if ($class === $name) {
+            return $this->loadModel($plugin . $class);
+        }
+
+        $trace = debug_backtrace();
+        $parts = explode('\\', get_class($this));
+        trigger_error(
+            sprintf(
+                'Undefined property: %s::$%s in %s on line %s',
+                array_pop($parts),
+                $name,
+                $trace[0]['file'],
+                $trace[0]['line']
+            ),
+            E_USER_NOTICE
+        );
 
-        return $this->loadModel($plugin . $class);
+        return false;
     }
 
     /**