use CoreFramework\Generic\UnsupportedOperationException;
// Import SPL stuff
+use \InvalidArgumentException;
use \SplFileInfo;
/**
*
* @param $fileInstance 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 mode is empty
* @throws FileIoException If fopen() returns not a file resource
* @return void
*/
public static final function createFrameworkTextFileOutputPointer (SplFileInfo $fileInstance, $mode) {
// Some pre-sanity checks...
- if (is_null($fileInstance)) {
+ if (empty($mode)) {
// No filename 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 = $fileInstance->openFile($mode);
+
+ // Is it valid?
if ((is_null($fileObject)) || ($fileObject === false)) {
// Something bad happend
- throw new FileIoException ($fileName, self::EXCEPTION_FILE_POINTER_INVALID);
+ throw new FileIoException($fileInstance, self::EXCEPTION_FILE_POINTER_INVALID);
} // END - if
// Create new instance