From: Roland Haeder Date: Fri, 24 Feb 2017 20:05:49 +0000 (+0100) Subject: The class loader is also now strict in namespace check, so nice backtraces will X-Git-Url: https://git.mxchange.org/?p=core.git;a=commitdiff_plain;h=8d25d89d86e4d0533af13a1acfaa5005a489c550 The class loader is also now strict in namespace check, so nice backtraces will be created. Signed-off-by: Roland Häder --- diff --git a/inc/loader/class_ClassLoader.php b/inc/loader/class_ClassLoader.php index ed5b7825..95e26bb1 100644 --- a/inc/loader/class_ClassLoader.php +++ b/inc/loader/class_ClassLoader.php @@ -7,6 +7,7 @@ use CoreFramework\Configuration\FrameworkConfiguration; use CoreFramework\Object\BaseFrameworkSystem; // Import SPL stuff +use \InvalidArgumentException; use \RecursiveDirectoryIterator; use \RecursiveIteratorIterator; @@ -35,8 +36,8 @@ use \RecursiveIteratorIterator; * ---------------------------------- * 1.5 * - Namespace scheme Project\Package[\SubPackage...] is fully supported and - * throws an E_USER_WARNING if not present. The last part will be always the - * class' name. + * throws an InvalidArgumentException if not present. The last part will be + * always the class' name. * 1.4 * - Some comments improved, other minor improvements * 1.3 @@ -422,7 +423,7 @@ class ClassLoader { // At least 3 parts should be there if (count($classNameParts) < 3) { // Namespace scheme is: Project\Package[\SubPackage...] - trigger_error(sprintf('Class name "%s" is not conform to naming-convention: Project\Package[\SubPackage...]\SomeFooBar', $className), E_USER_WARNING); + throw new InvalidArgumentException(sprintf('Class name "%s" is not conform to naming-convention: Project\Package[\SubPackage...]\SomeFooBar', $className)); } // END - if // Get last element