X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=framework%2Fmain%2Fclasses%2Ffile_directories%2Fdirectory%2Fclass_FrameworkDirectoryPointer.php;h=5dfb15cb9ae6224fb34a0ccfe1484db81834dbc8;hb=63f5632b0c5d2cebf8dd0940fdab561f86470f80;hp=8bcb3ccfc839d71c9721c61380b38cc5b7f15fba;hpb=78a010fef84895720e796842208f01dfb619c332;p=core.git diff --git a/framework/main/classes/file_directories/directory/class_FrameworkDirectoryPointer.php b/framework/main/classes/file_directories/directory/class_FrameworkDirectoryPointer.php index 8bcb3ccf..5dfb15cb 100644 --- a/framework/main/classes/file_directories/directory/class_FrameworkDirectoryPointer.php +++ b/framework/main/classes/file_directories/directory/class_FrameworkDirectoryPointer.php @@ -4,6 +4,7 @@ namespace CoreFramework\Filesytem\Pointer; // Import framework stuff use CoreFramework\Filesystem\FrameworkDirectory; +use CoreFramework\Generic\NullPointerException; use CoreFramework\Object\BaseFrameworkSystem; // Import SPL stuff @@ -69,44 +70,26 @@ class FrameworkDirectoryPointer extends BaseFrameworkSystem implements Framework * be verified here. * * @param $pathName The path name we shall pass to opendir() - * @param $inConstructor If we are in de/con-structor or from somewhere else * @return $pointerInstance A prepared instance of FrameworkDirectoryPointer - * @throws PathIsEmptyException If the provided path name is empty + * @throws NullPointerException If the provided path name is null * @throws InvalidPathStringException If the provided path name is not a string * @throws PathIsNoDirectoryException If the provided path name is not valid * @throws PathReadProtectedException If the provided path name is read-protected - * @todo Get rid of inConstructor, could be old-lost code. */ - public static final function createFrameworkDirectoryPointer ($pathName, $inConstructor = FALSE) { + public static final function createFrameworkDirectoryPointer ($pathName) { // Some pre-sanity checks... if (is_null($pathName)) { // No pathname given - if ($inConstructor) { - return NULL; - } else { - throw new PathIsEmptyException(NULL, self::EXCEPTION_UNEXPECTED_EMPTY_STRING); - } + throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER); } elseif (!is_string($pathName)) { // Is not a string - if ($inConstructor) { - return NULL; - } else { - throw new InvalidPathStringException(NULL, self::EXCEPTION_INVALID_STRING); - } + throw new InvalidPathStringException(NULL, self::EXCEPTION_INVALID_STRING); } elseif (!is_dir($pathName)) { // Not a directory - if ($inConstructor) { - return NULL; - } else { - throw new PathIsNoDirectoryException($pathName, self::EXCEPTION_INVALID_PATH_NAME); - } + throw new PathIsNoDirectoryException($pathName, self::EXCEPTION_INVALID_PATH_NAME); } elseif (!is_readable($pathName)) { // Not readable - if ($inConstructor) { - return NULL; - } else { - throw new PathReadProtectedException($pathName, self::EXCEPTION_READ_PROTECED_PATH); - } + throw new PathReadProtectedException($pathName, self::EXCEPTION_READ_PROTECED_PATH); } // Create new instance