// Import SPL stuff
use \DirectoryIterator;
+use \InvalidArgumentException;
/**
* A class for directory reading and getting its contents, no recursion!
* @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);