From 4242a05a0ec4fd9221780a0c46ded3aa17caa1cd Mon Sep 17 00:00:00 2001 From: Pierre Minnieur Date: Wed, 21 Dec 2011 11:50:24 +0100 Subject: [PATCH 1/2] added Boolean return values for loadClass() method --- src/Composer/Autoload/ClassLoader.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Composer/Autoload/ClassLoader.php b/src/Composer/Autoload/ClassLoader.php index 2ec3bde2a..fb1219577 100644 --- a/src/Composer/Autoload/ClassLoader.php +++ b/src/Composer/Autoload/ClassLoader.php @@ -83,12 +83,16 @@ class ClassLoader * Loads the given class or interface. * * @param string $class The name of the class + * @return Boolean True, if loaded */ public function loadClass($class) { if ($file = $this->findFile($class)) { require $file; + return true; } + + return false; } /** @@ -134,4 +138,4 @@ class ClassLoader } } } -} \ No newline at end of file +} From 3b1843827a5e6d9d910b9f59897ad1d74e74cd8f Mon Sep 17 00:00:00 2001 From: Pierre Minnieur Date: Wed, 21 Dec 2011 13:30:25 +0100 Subject: [PATCH 2/2] removed the `return false` as we only need a positive return information --- src/Composer/Autoload/ClassLoader.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Composer/Autoload/ClassLoader.php b/src/Composer/Autoload/ClassLoader.php index fb1219577..48ed424fb 100644 --- a/src/Composer/Autoload/ClassLoader.php +++ b/src/Composer/Autoload/ClassLoader.php @@ -83,7 +83,7 @@ class ClassLoader * Loads the given class or interface. * * @param string $class The name of the class - * @return Boolean True, if loaded + * @return Boolean|null True, if loaded */ public function loadClass($class) { @@ -91,8 +91,6 @@ class ClassLoader require $file; return true; } - - return false; } /**