From 538cdc914bcea471c96bd438b2beaa3b0a311506 Mon Sep 17 00:00:00 2001 From: Joe Holdcroft Date: Wed, 14 Nov 2012 11:46:49 +0000 Subject: [PATCH] Making prepend work with fallbacks & coding standards --- src/Composer/Autoload/ClassLoader.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Composer/Autoload/ClassLoader.php b/src/Composer/Autoload/ClassLoader.php index 1b4823742..9c039d4ea 100644 --- a/src/Composer/Autoload/ClassLoader.php +++ b/src/Composer/Autoload/ClassLoader.php @@ -85,7 +85,11 @@ class ClassLoader { if (!$prefix) { foreach ((array) $paths as $path) { - $this->fallbackDirs[] = $path; + if ($prepend) { + array_unshift($this->fallbackDirs, $path); + } else { + $this->fallbackDirs[] = $path; + } } return; @@ -100,8 +104,7 @@ class ClassLoader (array) $paths, $this->prefixes[$prefix] ); - } - else { + } else { $this->prefixes[$prefix] = array_merge( $this->prefixes[$prefix], (array) $paths