public function map($callback)
    {
        if (!is_callable($callback)) {
            throw new InvalidArgumentException('Callback has to be a valid callable, '.gettype($callback).' given.');
        }

        for ($i = 0; $this->checkIfLineNumberIsValid($i, false); $i++) {
            $this->setCurrentLineNumber($i);
            call_user_func($callback, $this->getLine($i), $i, $this);
        }
    }