@param $repository
@param $type
@param $format

@return \PUGX\Badge\Model\Badge
1611
public function createDownloadsBadge($repository, $type, $format)
    {
        return $this->createBadgeFromRepository($repository, self::SUBJECT, self::COLOR, $format, $type);
    }
1241453
protected function entityVote($model, $type, $partial = 'parts/vote', $format = 'json')
    {
        $data = ['status' => false];

        if ($model && Vote::isUserCan($model, Yii::$app->user->id)) {
            $data = [
                'status' => true,
                'html' => $this->controller->renderPartial($partial, ['model' => Vote::process($model, $type)])
            ];
        }

        if (Yii::$app->request->isAjax) {
            return new Response([
                'data' => $data,
                'format' => $format
            ]);
        }

        return $this->controller->redirect([$this->viewRoute, 'id' => $model['id']]);
    }
1187519
public function displayValue($locale = null, $internationalFormat = null, $format = true)
    {
        return LaraCart::formatMoney(
            $this->discount(),
            $locale,
            $internationalFormat,
            $format
        );
    }
356630
public function format($format)
    {
        if(Format::exist($format))
            $this->format = Format::get($format);
        else
            Format::invalidType();

        return $this;
    }
469972
public function date(string $format = Date::DISPLAY_FORMAT) : DateFieldBuilder
    {
        return new DateFieldBuilder($this->field->type(new DateType($format)));
    }
1162370
public function convertId($id, $format = null)
    {
        $this->convertToAll($id);

        switch ($format) {
            case 'ID32':
            case 'id32':
            case 32:
                return $this->formatted->{self::$ID32};
            case 'ID64':
            case 'id64':
            case 64:
                return $this->formatted->{self::$ID64};
            case 'ID3':
            case 'id3':
            case 3:
                return $this->formatted->{self::$ID3};
            default:
                return $this->formatted;
        }
    }
994779
public function getEpcValidUntil($format = 'Y-m-d')
    {
        if ($this->epcValidUntil instanceof \DateTime && $format !== null) {
            return $this->epcValidUntil->format($format);
        }

        return $this->epcValidUntil;
    }
430347
public function getCode($format)
    {
        foreach ($this->codes as $code) {
            if ($code->getFormat() == $format) {
                return $code;
            }
        }
    }
41238
public function addFormat($format, $mime_types)
    {
        static::$_formats[$format] = is_array($mime_types) ? $mime_types : array($mime_types);
        return $this;
    }
565671
public function getDataVencimento($format = 'd/m/Y')
    {
        return $this->dataVencimento instanceof Carbon
        ? $format === false ? $this->dataVencimento : $this->dataVencimento->format($format)
        : null;
    }
867835
public function setDataOcorrencia($dataOcorrencia, $format = 'dmy')
    {
        $this->dataOcorrencia = trim($dataOcorrencia, '0 ') ? Carbon::createFromFormat($format, $dataOcorrencia) : null;

        return $this;
    }
684045
public function serializeRepositoryFilter(VisitorInterface $visitor, RepositoryFilterInterface $repositoryFilter, array $type, Context $context)
    {
        return $visitor->visitArray(iterator_to_array($repositoryFilter), $type, $context);
    }
56409
protected function createRepository(ObjectAccess $repository)
    {
        if ($repository->exists('packagist')) {
            return new PackagistRepository(
                $repository->get('packagist'),
                $repository->data()
            );
        }

        $type = $repository->get('type');

        if ('package' === $type) {
            $repository = new PackageRepository(
                $this->objectToArray($repository->get('package')),
                $this->objectToArray($repository->getDefault('options')),
                $repository->data()
            );
        } else {
            $repository = new Repository(
                $type,
                $repository->getDefault('url'),
                $this->objectToArray($repository->getDefault('options')),
                $repository->data()
            );
        }

        return $repository;
    }
801111
public function getRepository($type)
    {
        try {
            $ldapObjectSchema = $this->getLdapObjectSchema($type);
            $repositoryClass = $ldapObjectSchema->getRepository();
            if (!class_exists($repositoryClass)) {
                throw new \RuntimeException(sprintf('Repository class "%s" not found.', $repositoryClass));
            }
            $repository = new $repositoryClass($ldapObjectSchema, $this->getConnection());
            if (!($repository instanceof LdapObjectRepository)) {
                throw new \RuntimeException('Your repository class must extend \LdapTools\Object\LdapObjectRepository.');
            }
        } catch (\Exception $e) {
            throw new \RuntimeException(sprintf('Unable to load Repository for type "%s": %s', $type, $e->getMessage()));
        } catch (\Throwable $e) {
            throw new \RuntimeException(sprintf('Unable to load Repository for type "%s": %s', $type, $e->getMessage()));
        }

        return $repository;
    }
1288742
public static function build($format, $type = 'm'): string
    {
        $format = null === $format ? '' : implode(';', (array)$format);

        return "\033[" . implode(';', (array)$format) . $type;
    }
995890
public function setDataVencimento($dataVencimento, $format = 'dmY')
    {
        $this->dataVencimento = trim($dataVencimento, '0 ') ? Carbon::createFromFormat($format, $dataVencimento) : null;

        return $this;
    }
1032302
public function createComposerLockBadge($repository, $format = 'svg')
    {
        $repo = str_replace('.git', '', $this->packageRepository
            ->fetchByRepository($repository)
            ->getOriginalObject()
            ->getRepository()
        );

        $request = $this->client->head(
            $repo . '/blob/master/composer.lock',
            array(),
            array(
                'timeout'         => 2,
                'connect_timeout' => 1,
                'exceptions'      => false,
            )
        );

        $response = $this->client->send($request);
        $status = 500;
        if ($request) {
            $status = $response->getStatusCode();
        }

        $this->text = self::LOCK_ERROR;
        $color      = self::COLOR_ERROR;
        $subject    = self::SUBJECT_ERROR;
        if (200 === $status) {
            $this->text = self::LOCK_COMMITTED;
            $color      = self::COLOR_COMMITTED;
            $subject    = self::SUBJECT;
        } elseif (404 === $status) {
            $this->text = self::LOCK_UNCOMMITTED;
            $color      = self::COLOR_UNCOMMITTED;
            $subject    = self::SUBJECT;
        }

        return $this->createBadgeFromRepository($repository, $subject, $color, $format);
    }