public function format(string $format) : self
    {
        if (! in_array($format, self::VALID_FORMATS)) {
            throw new Exception('Invalid format provided to path.');
        }

        $this->format = $format;

        return $this;
    }
public function format(string $format) : self
    {
        if (! in_array($format, self::VALID_FORMATS)) {
            throw new Exception('Invalid format provided to path.');
        }

        $this->format = $format;

        return $this;
    }
public function format ( string $ format ) : self { if ( ! in_array ( $ format , self :: VALID_FORMATS ) ) { throw new Exception ( 'Invalid format provided to path.' ) ; } $ this -> format = $ format ; return $ this ; }
Set the return format.

@param  string $format
@return self
Set the return format .