Permalink
Browse files

[ClassLoader] fixed CS

  • Loading branch information...
1 parent 040abef commit 33066c11cc23498409eb2a699474761b14deca37 @fabpot fabpot committed Aug 13, 2011
Showing with 17 additions and 13 deletions.
  1. +17 −13 UniversalClassLoader.php
View
@@ -220,13 +220,15 @@ public function findFile($class)
// namespaced class name
$namespace = substr($class, 0, $pos);
foreach ($this->namespaces as $ns => $dirs) {
- if (0 === strpos($namespace, $ns)) {
- foreach ($dirs as $dir) {
- $className = substr($class, $pos + 1);
- $file = $dir.DIRECTORY_SEPARATOR.str_replace('\\', DIRECTORY_SEPARATOR, $namespace).DIRECTORY_SEPARATOR.str_replace('_', DIRECTORY_SEPARATOR, $className).'.php';
- if (file_exists($file)) {
- return $file;
- }
+ if (0 !== strpos($namespace, $ns)) {
+ continue;
+ }
+
+ foreach ($dirs as $dir) {
+ $className = substr($class, $pos + 1);
+ $file = $dir.DIRECTORY_SEPARATOR.str_replace('\\', DIRECTORY_SEPARATOR, $namespace).DIRECTORY_SEPARATOR.str_replace('_', DIRECTORY_SEPARATOR, $className).'.php';
+ if (file_exists($file)) {
+ return $file;
}
}
}
@@ -240,12 +242,14 @@ public function findFile($class)
} else {
// PEAR-like class name
foreach ($this->prefixes as $prefix => $dirs) {
- if (0 === strpos($class, $prefix)) {
- foreach ($dirs as $dir) {
- $file = $dir.DIRECTORY_SEPARATOR.str_replace('_', DIRECTORY_SEPARATOR, $class).'.php';
- if (file_exists($file)) {
- return $file;
- }
+ if (0 !== strpos($class, $prefix)) {
+ continue;
+ }
+
+ foreach ($dirs as $dir) {
+ $file = $dir.DIRECTORY_SEPARATOR.str_replace('_', DIRECTORY_SEPARATOR, $class).'.php';
+ if (file_exists($file)) {
+ return $file;
}
}
}

0 comments on commit 33066c1

Please sign in to comment.