public function createWriter(bool $append = true): CsvWriterInterface
    {
        $stream = $this->openStream($append ? 'a+' : 'w+');

        $writer = new CsvStreamWriter($stream);
        $writer->setCsvControl($this->delimiter, $this->enclosure, $this->escape);

        if ($this->associativeRows) {
            $writer = new AssociativeWriterDecorator($writer);
            if ($this->headers) {
                $writer->setHeaders($this->headers);
            }
        }

        return $writer;
    }
public function createWriter(bool $append = true): CsvWriterInterface
    {
        $stream = $this->openStream($append ? 'a+' : 'w+');

        $writer = new CsvStreamWriter($stream);
        $writer->setCsvControl($this->delimiter, $this->enclosure, $this->escape);

        if ($this->associativeRows) {
            $writer = new AssociativeWriterDecorator($writer);
            if ($this->headers) {
                $writer->setHeaders($this->headers);
            }
        }

        return $writer;
    }
public function createWriter ( bool $ append = true ) : CsvWriterInterface { $ stream = $ this -> openStream ( $ append ? 'a+' : 'w+' ) ; $ writer = new CsvStreamWriter ( $ stream ) ; $ writer -> setCsvControl ( $ this -> delimiter , $ this -> enclosure , $ this -> escape ) ; if ( $ this -> associativeRows ) { $ writer = new AssociativeWriterDecorator ( $ writer ) ; if ( $ this -> headers ) { $ writer -> setHeaders ( $ this -> headers ) ; } } return $ writer ; }
Create a writer to be used externally.

@param bool $append

@return CsvWriterInterface
Create a writer to be used externally .