public function forceMimeType(string $mime)
    {
        if (!isset($this->file_formats[$mime]))
        {
            throw new \InvalidArgumentException(
                "Cannot force output without a writer available: " . $mime
            );
        }

        $this->file_formats = [$mime => $this->file_formats[$mime]];
        return $this;
    }
public function forceMimeType(string $mime)
    {
        if (!isset($this->file_formats[$mime]))
        {
            throw new \InvalidArgumentException(
                "Cannot force output without a writer available: " . $mime
            );
        }

        $this->file_formats = [$mime => $this->file_formats[$mime]];
        return $this;
    }
public function forceMimeType ( string $ mime ) { if ( ! isset ( $ this -> file_formats [ $ mime ] ) ) { throw new \ InvalidArgumentException ( "Cannot force output without a writer available: " . $ mime ) ; } $ this -> file_formats = [ $ mime => $ this -> file_formats [ $ mime ] ] ; return $ this ; }
Reduce the list of available file formats to a single one
@param string $mime The mime type to output. Must already be known
@return DataResponse Provides fluent interface
Reduce the list of available file formats to a single one