From ac99e54f17295e58183c1e3ce94982eaeaabc0fe Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Tue, 18 Aug 2015 09:27:34 +0200 Subject: [PATCH] Fix PHPDoc in ClassLoader refs #5786 --- library/Icinga/Application/ClassLoader.php | 29 +++++++++++----------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/library/Icinga/Application/ClassLoader.php b/library/Icinga/Application/ClassLoader.php index 17d7e9e33..e31aa49af 100644 --- a/library/Icinga/Application/ClassLoader.php +++ b/library/Icinga/Application/ClassLoader.php @@ -5,6 +5,9 @@ namespace Icinga\Application; use Icinga\Exception\ProgrammingError; +/** + * PSR-4 class loader + */ class ClassLoader { /** @@ -13,14 +16,14 @@ class ClassLoader const NAMESPACE_SEPARATOR = '\\'; /** - * List of namespaces + * Namespaces * * @var array */ private $namespaces = array(); /** - * Register new namespace for directory + * Register a base directory for a namespace prefix * * @param string $namespace * @param string $directory @@ -44,9 +47,9 @@ class ClassLoader } /** - * Test if a namespace exists + * Test whether a namespace exists * - * @param string $namespace + * @param string $namespace * * @return bool */ @@ -56,13 +59,11 @@ class ClassLoader } /** - * Class loader + * Load the given class or interface * - * Ignores all but classes in registered namespaces. + * @param string $class Name of the class or interface * - * @param string $class - * - * @return boolean + * @return bool Whether the class or interface has been loaded */ public function loadClass($class) { @@ -82,7 +83,7 @@ class ClassLoader } /** - * Test if we have a registered namespaces for this class + * Get the namespace for the given class * * Return is the longest match in the array found * @@ -114,17 +115,15 @@ class ClassLoader } /** - * Effectively registers the autoloader the PHP/SPL way + * Register {@link loadClass()} as an autoloader */ public function register() { - // Think about to add class pathes to php include path - // this could be faster (tg) spl_autoload_register(array($this, 'loadClass')); } /** - * Detach autoloader from spl registration + * Unregister {@link loadClass()} as an autoloader */ public function unregister() { @@ -132,7 +131,7 @@ class ClassLoader } /** - * Detach spl autoload method from stack + * Unregister this as an autloader */ public function __destruct() {