@param string $data

@param string $format

@return $this
960770
public function setData($data, $format = 'dmY')
    {
        $this->data = trim($data, '0 ') ? Carbon::createFromFormat($format, $data) : null;

        return $this;
    }
356630
public function format($format)
    {
        if(Format::exist($format))
            $this->format = Format::get($format);
        else
            Format::invalidType();

        return $this;
    }
1344272
public function setFormats($formats)
    {
        $this->formats = Type::forceAndReturn($formats, ArrayAccess::class);
        $this->formatCache = [];
        return $this;
    }
546865
public function setDataGravacao($dataGravacao, $format = 'dmY')
    {
        $this->dataGravacao = trim($dataGravacao, '0 ') ? Carbon::createFromFormat($format, $dataGravacao) : null;

        return $this;
    }
637832
public static function setFormatDefinition($name, $format) {
        if (!self::$formats) {
            self::$formats = self::initFormats();
        }

        self::$formats[$name] = $format;
    }
306718
protected function setFormat($format = null)
    {
        if ($format == '' && $this->image instanceof Image) {
            $format = $this->image->mime;
        }

        $this->format = $format ? $format : 'jpg';

        return $this;
    }
63481
public function setLastModified( $date, $format = null )
    {
        $this->_lastModified = $this->inputDate( $date, $format );
        return $this;
    }
382545
public static function fromFormat(string $format, string $dateString) : DateTime
    {
        return new self(\DateTimeImmutable::createFromFormat('!' . $format, $dateString));
    }
257789
public function setDataFormat($dataFormat)
    {
        if (!in_array($dataFormat, static::FORMATS)) {
            throw new \InvalidArgumentException("bad format '{$dataFormat}'");
        }
        $this->dataFormat = $dataFormat;

        return $this;
    }
462831
public function format($format = null)
    {
        if (!$format) {
            $format = $this->getFormat();
        }

        return parent::format($format ?: static::$toStringFormat);
    }
274287
protected function applyDefaultFormat($format, $options, $data)
    {
        $aClassFunc = $this->getFuncParams($options);

        $params = array_key_exists('params', $format) && isset($options['params']) ? $format['params'] : [];

        if (!is_array($params)) {
            $params = [$params];
        }

        array_unshift($params, $data);

        $object = (new \ReflectionClass($aClassFunc['class']))->newInstance();

        $data = call_user_func_array([$object, $aClassFunc['method']], $params);

        return $data;
    }
1296812
public function setFormat($format) {

        $this->checkInArray($format, GDAXConstants::$reportFormatValues);
        $this->format = $format;
        return $this;

    }
1278619
public function add($value, $format = '(%s)')
	{
		array_push($this->pattern, sprintf($format, $this->sanitize($value)));

		return $this;
	}
327882
public function setFileFormats(array $formats)
    {
        $this->file_formats = array();
        foreach ($formats as $mime => $writer)
            $this->addFileFormat($mime, $writer);

        return $this;
    }
1102906
protected static function format(array $data, $format)
    {
        $format = strtolower($format);
        switch ($format) {
            case static::CONTENT_TYPE_FORM:
                return http_build_query($data);
            case static::CONTENT_TYPE_JSON:
                return json_encode($data);
            default:
                throw new InvalidArgumentException('Format not supported');
        }
    }
41238
public function addFormat($format, $mime_types)
    {
        static::$_formats[$format] = is_array($mime_types) ? $mime_types : array($mime_types);
        return $this;
    }
1110673
public function setFormat($name, FormatInterface $format)
    {
        // If name is int or null, get name from Format object.
        $name = (is_numeric($name) || !$name) ? $format->getName() : $name;

        $this->formats[$name] = $format;

        return $this;
    }