@param object $data
@param string $format

@return bool
181337
public function supportsNormalization($data, $format = null)
    {
        if (!is_object($data)) {
            return false;
        }

        $class = get_class($data);
        if (!$this->entityMetadataFactory->hasMetadataFor($class)
        or $this->entityMetadataFactory->getMetadataFor($class)->isEmbeddedClass) {
            return false;
        }

        return parent::supportsNormalization($data, $format);
    }
647699
public static function isSupportedFormat($format)
    {
        if (!is_string($format)) {
            throw new Exception\InvalidArgumentException(__METHOD__ . " file_format must be a string");
        }
        return in_array((string) $format, self::$supportedFormats);
    }
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');
        }
    }
874570
public function isFormatNumber($format = null)
    {
        if (null !== $format) {
            $this->formatNumber = (bool) $format;
        }

        return $this->formatNumber;
    }
448064
public function isNameValid($format, $name)
    {
        if (false === $this->isFormatValid($format)) {
            return false;
        }
        $name = iconv(mb_detect_encoding($name), 'UTF-8', $name);

        $valid = $this->nameFormats[$format];
        return !preg_match($valid, $name) ? false : true;
    }
565671
public function getDataVencimento($format = 'd/m/Y')
    {
        return $this->dataVencimento instanceof Carbon
        ? $format === false ? $this->dataVencimento : $this->dataVencimento->format($format)
        : null;
    }
177096
public function getFormattedImage($format)
    {
        $formatName = $format instanceof FormatInterface
            ? $format->getName()
            : $format
        ;

        return $this->formattedImages
            ->filter(function (FormattedImageInterface $formattedImage) use ($formatName) {
                return ($format = $formattedImage->getFormat())
                    && $format->getName() == $formatName
                ;
            })
            ->first() ?: null // first() returns "false" if collection empty
        ;
    }
1246802
public function validate($name, $data, $format = null)
    {
        if (!is_string($data)) {
            throw new Exception("propriedade [ {$name} ] é inválida para tipo [ string ] definido no schema", 400);
        }

        if ($format) {
            $data = self::applyFormat($format, $data);
        }

        return (string)$data;
    }
773289
private function isNotSmallerThanFormat($width, $height, array $format)
    {
        if (isset($format['scale']['x']) && $width < $format['scale']['x']) {
            return false;
        }
        if (isset($format['scale']['y']) && $height < $format['scale']['y']) {
            return false;
        }

        return true;
    }
396598
public function format($format = self::FORMAT_COMPLETE)
    {
        if (!$this->hasValidFormat()) {
            return false;
        }
        switch ($format) {
            case static::FORMAT_COMPLETE:
                return $this->join(
                    number_format($this->number, 0, null, "."),
                    $this->vn
                );
                break;

            case static::FORMAT_WITH_DASH:
                return $this->join($this->number, $this->vn);
                break;
        }
        return $this->number . $this->vn;
    }
1167871
private function validateFormat($format)
    {
        if (isset($this->formatsDate[$format])) {
            return $this->formatsDate[$format];
        }
        if (isset($this->formatsTime[$format])) {
            return $this->formatsTime[$format];
        }
        $format = strtolower($format);
        if (isset($this->formatsDate[$format])) {
            return $this->formatsDate[$format];
        }
        if (isset($this->formatsTime[$format])) {
            return $this->formatsTime[$format];
        }
    }
459612
public function loadString($data, $format='Json', array $options=[])
  {
    $handler = Format::getInstance($format);
    
    $obj = $handler->stringToObject($data, $options);
    $this->loadObject($obj);

    return true;
  }
927008
private function ffprobeFormat($format)
	{
		$this->ffprobe();

		if (count($this->formats) > 0)
		{
			$args = func_get_args();

			foreach ($args as $arg)
			{
				if (in_array($arg, $this->formats))
				{
					return true;
				}
			}

			return null;
		}

		return false;
	}
1076240
public static function hasFormat($date, $format)
    {
        try {
            // Try to create a DateTime object. Throws an InvalidArgumentException if the provided time string
            // doesn't match the format in any way.
            static::rawCreateFromFormat($format, $date);

            // createFromFormat() is known to handle edge cases silently.
            // E.g. "1975-5-1" (Y-n-j) will still be parsed correctly when "Y-m-d" is supplied as the format.
            // To ensure we're really testing against our desired format, perform an additional regex validation.

            // Preg quote, but remove escaped backslashes since we'll deal with escaped characters in the format string.
            $quotedFormat = str_replace('\\\\', '\\',
                preg_quote($format, '/'));

            // Build the regex string
            $regex = '';
            for ($i = 0; $i < strlen($quotedFormat); ++$i) {
                // Backslash – the next character does not represent a date token so add it on as-is and continue.
                // We're doing an extra ++$i here to increment the loop by 2.
                if ($quotedFormat[$i] === '\\') {
                    $regex .= '\\'.$quotedFormat[++$i];
                    continue;
                }

                $regex .= strtr($quotedFormat[$i], static::$regexFormats);
            }

            return (bool) preg_match('/^'.$regex.'$/', $date);
        } catch (InvalidArgumentException $e) {
        }

        return false;
    }
1036059
public static function loadString($data, $format = Format::JSON, $options = [])
    {
        // Load a string into the given namespace [or default namespace if not given]
        $class = static::getFormatClass($format);

        return $class::stringToStruct($data, $options);
    }
1149769
public function serialize($data, $format, array $context = array())
    {
        if (!isset($this->handlers[$format])) {
            throw new \BadMethodCallException(sprintf(
                'Unsupported format "%s", only [%s] are',
                $format, implode(', ', array_keys($this->handlers))
            ));
        }

        return $this->handlers[$format]->serialize(
            $data,
            empty($context['scope']) ? 'default' : $context['scope']
        );
    }
1111948
protected function stashCustomFormatOptions(&$format) {
		$format = str_replace($this->formatOptionsNames, $this->formatOptionsPlaceholders, $format, $count);
		return (bool)$count;
	}