The class loader is also now strict in namespace check, so nice backtraces will
authorRoland Haeder <roland@mxchange.org>
Fri, 24 Feb 2017 20:05:49 +0000 (21:05 +0100)
committerRoland Haeder <roland@mxchange.org>
Tue, 28 Feb 2017 21:10:04 +0000 (22:10 +0100)
be created.

Signed-off-by: Roland Häder <roland@mxchange.org>
inc/loader/class_ClassLoader.php

index ed5b7825fcba6f8364f4715536e392394034ce02..95e26bb1c05359edfcfa34e6459d5bcdc58f25f4 100644 (file)
@@ -7,6 +7,7 @@ use CoreFramework\Configuration\FrameworkConfiguration;
 use CoreFramework\Object\BaseFrameworkSystem;
 
 // Import SPL stuff
 use CoreFramework\Object\BaseFrameworkSystem;
 
 // Import SPL stuff
+use \InvalidArgumentException;
 use \RecursiveDirectoryIterator;
 use \RecursiveIteratorIterator;
 
 use \RecursiveDirectoryIterator;
 use \RecursiveIteratorIterator;
 
@@ -35,8 +36,8 @@ use \RecursiveIteratorIterator;
  * ----------------------------------
  * 1.5
  *  - Namespace scheme Project\Package[\SubPackage...] is fully supported and
  * ----------------------------------
  * 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
  * 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...]
                // 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
                } // END - if
 
                // Get last element