]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/file_directories/output/raw/class_FrameworkRawFileOutputPointer.php
Rewrites:
[core.git] / framework / main / classes / file_directories / output / raw / class_FrameworkRawFileOutputPointer.php
index a63535c69616164b422eb34c3f927c540f98b705..30189ba7a4d0e9361ca6397c9b689687a25379b7 100644 (file)
@@ -8,6 +8,7 @@ use CoreFramework\Filesystem\Pointer\OutputPointer;
 use CoreFramework\Generic\NullPointerException;
 
 // Import SPL stuff
+use \InvalidArgumentException;
 use \SplFileInfo;
 
 /**
@@ -49,22 +50,22 @@ class FrameworkRawFileOutputPointer extends BaseFileIo implements OutputPointer
         *
         * @param       $infoInstance   An instance of a SplFileInfo class
         * @param       $mode           The output mode ('w', 'a' are valid)
-        * @throws      FileIsEmptyException    If the provided file name is empty.
+        * @throws      InvalidArgumentException        If parameter mode is empty
         * @throws      FileIoException                 If fopen() returns not a file resource
         * @return      void
         */
        public static final function createFrameworkRawFileOutputPointer (SplFileInfo $infoInstance, $mode) {
                // Some pre-sanity checks...
-               if (is_null($infoInstance)) {
+               if (is_null($mode)) {
                        // No infoInstance given
-                       throw new FileIsEmptyException(NULL, self::EXCEPTION_UNEXPECTED_EMPTY_STRING);
+                       throw new InvalidArgumentException('Parameter "mode" is empty');
                } // END - if
 
                // Try to open a handler
                $fileObject = $infoInstance->openFile($mode);
                if ((is_null($fileObject)) || ($fileObject === false)) {
                        // Something bad happend
-                       throw new FileIoException ($infoInstance, self::EXCEPTION_FILE_POINTER_INVALID);
+                       throw new FileIoException($infoInstance, self::EXCEPTION_FILE_POINTER_INVALID);
                } // END - if
 
                // Create new instance