]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/file_directories/directory/class_FrameworkDirectoryPointer.php
Continued:
[core.git] / framework / main / classes / file_directories / directory / class_FrameworkDirectoryPointer.php
index 6816e4e4c6165f2655f1fd972da513e8cc28ae9a..a39c83a9e30f59c1cac404602449f880a7259b68 100644 (file)
@@ -12,6 +12,7 @@ use Org\Mxchange\CoreFramework\Deprecated\PathIsNoDirectoryException;
 
 // Import SPL stuff
 use \DirectoryIterator;
+use \InvalidArgumentException;
 
 /**
  * A class for directory reading and getting its contents, no recursion!
@@ -79,14 +80,11 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem implements Framework
         * @throws      PathIsNoDirectoryException      If the provided path name is not valid
         * @throws      PathReadProtectedException      If the provided path name is read-protected
         */
-       public static final function createFrameworkDirectoryPointer ($pathName) {
+       public static final function createFrameworkDirectoryPointer (string $pathName) {
                // Some pre-sanity checks...
-               if (is_null($pathName)) {
-                       // No pathname given
-                       throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
-               } elseif (!is_string($pathName)) {
-                       // Is not a string
-                       throw new InvalidPathStringException(NULL, self::EXCEPTION_INVALID_STRING);
+               if (empty($pathName)) {
+                       // Throw IAE
+                       throw new InvalidArgumentException('Parameter "pathName" is empty');
                } elseif (!is_dir($pathName)) {
                        // Not a directory
                        throw new PathIsNoDirectoryException($pathName, self::EXCEPTION_INVALID_PATH_NAME);