Permalink
Browse files

Remove nested conditional.

  • Loading branch information...
markstory committed Sep 15, 2013
1 parent 99b1c0b commit 616907c7c8bb011e867ee6c2f6fc73ae5f183cb0
Showing with 5 additions and 7 deletions.
  1. +5 −7 Cake/Core/App.php
View
@@ -23,7 +23,6 @@
/**
* App is responsible for resource location, and path management.
*
*
* ### Adding paths
*
* Additional paths for Views and Plugins are configured with Configure now. See App/Config/app.php for an
@@ -83,10 +82,8 @@ public static function classname($class, $type = '', $suffix = '') {
}
list($plugin, $name) = pluginSplit($class);
$checkCore = true;
if ($plugin) {
$base = Plugin::getNamespace($plugin);
$checkCore = false;
} else {
$base = Configure::read('App.namespace');
}
@@ -96,11 +93,12 @@ public static function classname($class, $type = '', $suffix = '') {
if (class_exists($base . $fullname)) {
return $base . $fullname;
}
if ($plugin) {
return false;
}
if ($checkCore) {
if (class_exists('Cake' . $fullname)) {
return 'Cake' . $fullname;
}
if (class_exists('Cake' . $fullname)) {
return 'Cake' . $fullname;
}
return false;
}

0 comments on commit 616907c

Please sign in to comment.