@param string $format

@return mixed
6487
public function getDocs($format = 'array')
    {
        if ($format == 'json') {
            $filler = [];
            foreach ($this->docs as $doc) {
                $filler[] = $doc->toArray();
            }

            return json_encode($filler, true);
        }

        return $this->docs;
    }
692725
public function format($format)
    {
        $format = str_replace('%U', sprintf("%06d", $this->u), $format);
        $format = str_replace('%u', sprintf("%d", intval($this->u)), $format);

        return parent::format($format);
    }
980785
public function getTimestamp($format = self::TIMESTAMP_FORMAT_RFC1123) {
		$this->ensureInput();
		if(!isset($this->input['timestamp'])) return null;
		switch($format) {
			case static::TIMESTAMP_FORMAT_UNIX:
				return strtotime($this->input['timestamp']);
			case static::TIMESTAMP_FORMAT_RFC1123:
			default:
				return $this->input['timestamp'];
		}
	}
1243211
public static function getMimeTypes($format)
    {
        if (null === static::$formats) {
            static::initializeFormats();
        }

        return isset(static::$formats[$format]) ? static::$formats[$format] : [];
    }
292055
protected function getFormat($format)
    {
        if ($format === false) {
            $format = 'none';
        }
        
        $types = [
            'none' => \IntlDateFormatter::NONE,
            'short' => \IntlDateFormatter::SHORT,
            'medium' => \IntlDateFormatter::MEDIUM,
            'long' => \IntlDateFormatter::LONG,
            'full' => \IntlDateFormatter::FULL
        ];
        
        return isset($types[$format]) ? $types[$format] : null;
    }
268747
private function convertFormat($format)
    {
        if (is_array($format)) {
            // sounds like the format is already done, let's keep it as it is
            return $format;
        }
        if (array_key_exists($format, $this->formats)) {
            // it's a format defined in config, let's use all defined parameters
            return $this->formats[$format];
        } elseif (preg_match("/^([0-9]*)x([0-9]*)/", $format)) {
            // it's a custom [width]x[height] format, let's make a thumb
            return array('thumbnail' => $format);
        } else {
            throw new InvalidArgumentException(sprintf("Unknown IM format: %s", $format));
        }
    }
728259
public function format($format = '')
    {
        if ($this->isHollow()) {
            $format = $this->format;
        } else {
            $format = $format ?: $this->format;
        }

        return parent::format($format);
    }
627194
public function format(string $format) : string
    {
        // Replace microseconds first so they become literals.
        // Ignore any escaped microsecond identifiers.
        $format = preg_replace_callback(
            // Starting at the start of the string or the first non % character,
            // consume pairs of % characters (effectively consuming all escaped %s)
            // and finally match the string %u.
            '/((?:^|[^%])(?:%{2})*)(%u)/',
            function (array $matches) {
                return $matches[1] . $this->microseconds;
            },
            $format
        );

        $format = $this->wrapped->format($format);
        
        return $format;
    }
953343
public function format($format)
    {
        $function = $this->localFormatFunction ?: static::$formatFunction;

        if (!$function) {
            return $this->rawFormat($format);
        }

        if (is_string($function) && method_exists($this, $function)) {
            $function = [$this, $function];
        }

        return $function(...func_get_args());
    }
755936
public function getMimeType($format)
    {
        if (null === static::$formats) {
            static::initializeFormats();
        }

        return isset(static::$formats[$format]) ? static::$formats[$format][0] : null;
    }
684859
public function getImage(string $format = null) : string
    {
        if (!$format) {
            $format = explode('/', $this->info['mime'], 2)[1];
        }
        switch (strtolower($format)) {
            case 'jpg':
            case 'jpeg':
                ob_start();
                imagejpeg($this->data);
                return ob_get_clean();
            case 'bitmap':
            case 'bmp':
                ob_start();
                imagewbmp($this->data);
                return ob_get_clean();
            case 'png':
                ob_start();
                imagepng($this->data);
                return ob_get_clean();
            case 'gif':
                ob_start();
                imagegif($this->data);
                return ob_get_clean();
            case 'webp':
                ob_start();
                imagewebp($this->data, null);
                return ob_get_clean();
            default:
                throw new ImageException('Unsupported format');
        }
    }
205288
public function getFormatInstance($format = null)
    {
        $format = $format ?: $this->format;

        if (!($format instanceof FormatInterface)) {
            if (!isset($this->formats[$format])) {
                $event = new NewFormatEvent($this, new $format($this));
                $this->trigger($event);
                $this->formats[$format] = $event->getFormat();
            }

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

        return $format;
    }
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;
    }
546496
public function getApiURL($format = null)
    {
        $apiUrl = str_replace(['.'.$this->format, '?limit=0'], '', $this->apiURL);
        return $apiUrl.(empty($format) ? '' : '.'.$format );
    }
817179
protected function generateImage(string $format): string
    {
        $url = $this->generateUrl($format);

        $content = file_get_contents($url);

        if ($content === false) {
            $content = '';
        }

        return $content;
    }
1317402
public function getParameters($format = self::FETCH_ASSOC) {

        if ( $format === self::FETCH_NUMERIC ) return array_values($this->signatures[$this->current_signature]["PARAMETERS"]);

        else return $this->signatures[$this->current_signature]["PARAMETERS"];

    }
710825
public function toString($format = null) {
        // If no format is defined, use the one specified in the current class
        if (!isset($format)) {
            $format = self::DATETIME_FORMAT;
        }

        return $this->_dateTime->format($format) . '.' . self::_formatMilliseconds($this->_milliseconds);
    }