Skip to content

Commit

Permalink
Remove nested conditions.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Nov 28, 2012
1 parent 957d331 commit cd21ea3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/Cake/Core/ClassLoader.php
Expand Up @@ -127,13 +127,13 @@ public function unregister() {
* @return boolean
*/
public function loadClass($className) {
if (substr($className, 0, $this->namespaceLength) === $this->namespace) {
$path = $this->includePath . DS . str_replace('\\', DS, $className) . $this->fileExtension;
if (!file_exists($path)) {
return false;
}
return require $path;
if (substr($className, 0, $this->namespaceLength) !== $this->namespace) {
return false;
}
return false;
$path = $this->includePath . DS . str_replace('\\', DS, $className) . $this->fileExtension;
if (!file_exists($path)) {
return false;
}
return require $path;
}
}

0 comments on commit cd21ea3

Please sign in to comment.