// Import SPL stuff
use \InvalidArgumentException;
+use \OutOfBoundsException;
use \SplFileInfo;
/**
* @param $seekPosition Seek position in file
* @param $whence Added to offset (default: only use offset to seek to)
* @return $status Status of this operation
- * @throws InvalidArgumentException If a parameter is invalid
+ * @throws OutOfBoundsException If the position is not seekable
*/
public function seek (int $seekPosition, int $whence = SEEK_SET) {
// Validate parameter
/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('FIFO-FILE-STACK: seekPosition=%d,whence=%d - CALLED!', $seekPosition, $whence));
if ($seekPosition < 0) {
// Invalid seek position
- throw new InvalidArgumentException(sprintf('seekPosition=%d is not valid', $seekPosition));
+ throw new OutOfBoundsException(sprintf('seekPosition=%d is not valid', $seekPosition));
}
// @TODO Unfinished method or invoke inner iterator's method?