Skip to content

Commit

Permalink
Remove nested conditional.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Sep 15, 2013
1 parent 99b1c0b commit 616907c
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions Cake/Core/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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');
}
Expand All @@ -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;
}
Expand Down

0 comments on commit 616907c

Please sign in to comment.