public function defaultFormat($format)
    {
        $this->default = $format;

        if (isset($this->formats[$format])) {
            $item = $this->formats[$format];
            $this->formats = [$format => $item] + $this->formats;
        }

        return $this;
    }
public function defaultFormat($format)
    {
        $this->default = $format;

        if (isset($this->formats[$format])) {
            $item = $this->formats[$format];
            $this->formats = [$format => $item] + $this->formats;
        }

        return $this;
    }
public function defaultFormat ( $ format ) { $ this -> default = $ format ; if ( isset ( $ this -> formats [ $ format ] ) ) { $ item = $ this -> formats [ $ format ] ; $ this -> formats = [ $ format => $ item ] + $ this -> formats ; } return $ this ; }
Set the default format.
Set this to null if you want a 406 Not Acceptable response to be generated if no valid format was found.

@param string|null $format

@return self
Set the default format . Set this to null if you want a 406 Not Acceptable response to be generated if no valid format was found .