]> git.mxchange.org Git - core.git/blobdiff - framework/loader/class_ClassLoader.php
Continued:
[core.git] / framework / loader / class_ClassLoader.php
index e03429635566fa8a477cb28ba52431bb8ee115d9..9e0e4bacf06e35c18356a0df568735a3ed29861a 100644 (file)
@@ -62,12 +62,12 @@ class ClassLoader {
        /**
         * Array with all found classes
         */
-       private $foundClasses = array();
+       private $foundClasses = [];
 
        /**
         * List of loaded classes
         */
-       private $loadedClasses = array();
+       private $loadedClasses = [];
 
        /**
         * Suffix with extension for all class files
@@ -83,7 +83,7 @@ class ClassLoader {
         * A list for directory names (no leading/trailing slashes!) which not be scanned by the path scanner
         * @see scanLocalPath
         */
-       private $ignoreList = array();
+       private $ignoreList = [];
 
        /**
         * Debug this class loader? (true = yes, false = no)
@@ -134,7 +134,7 @@ class ClassLoader {
         * Registered paths where test classes can be found. These are all relative
         * to base_path .
         */
-       private static $testPaths = array();
+       private static $testPaths = [];
 
        /**
         * The protected constructor. Please use the factory method below, or use
@@ -351,7 +351,7 @@ class ClassLoader {
         * @param       $strictNamingConvention Whether to strictly check naming-convention
         * @return      void
         */
-       public static function enableStrictNamingConventionCheck ($strictNamingConvention = true) {
+       public static function enableStrictNamingConventionCheck (bool $strictNamingConvention = true) {
                self::$strictNamingConvention = $strictNamingConvention;
        }
 
@@ -362,7 +362,7 @@ class ClassLoader {
         * @param       $relativePath   Relative path to test classes
         * @return      void
         */
-       public static function registerTestsPath ($relativePath) {
+       public static function registerTestsPath (string $relativePath) {
                // Trace message
                //* NOISY-DEBUG: */ printf('[%s:%d]: relativePath=%s - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $relativePath);
 
@@ -379,7 +379,7 @@ class ClassLoader {
         * @param       $className      Name of the class to load
         * @return      void
         */
-       public static function autoLoad ($className) {
+       public static function autoLoad (string $className) {
                // Trace message
                //* NOISY-DEBUG: */ printf('[%s:%d]: className=%s - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $className);
 
@@ -413,7 +413,7 @@ class ClassLoader {
         * @param       $ignoreList             An optional list (array forced) of directory and file names which shall be ignored
         * @return      void
         */
-       public function scanClassPath ($basePath, array $ignoreList = array() ) {
+       public function scanClassPath (string $basePath, array $ignoreList = [] ) {
                // Is a list has been restored from cache, don't read it again
                if ($this->listCached === true) {
                        // Abort here
@@ -565,11 +565,9 @@ class ClassLoader {
         * @return      void
         * @throws      InvalidArgumentException        If strict-checking is enabled and class name is not following naming-convention
         */
-       private function loadClassFile ($className) {
-               // Trace message
-               //* NOISY-DEBUG: */ printf('[%s:%d] className=%s - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $className);
-
+       private function loadClassFile (string $className) {
                // The class name should contain at least 2 back-slashes, so split at them
+               //* NOISY-DEBUG: */ printf('[%s:%d] className=%s - CALLED!' . PHP_EOL, __METHOD__, __LINE__, $className);
                $classNameParts = explode("\\", $className);
 
                // At least 3 parts should be there