Get quality badge url

@param string $slug Repository slug
@param string $type Repository type (g=github, b=bitbucket)
@param string $qualityBadgeHash Badge hash
@return string
768176
public function getQualityBadgeUrl($slug, $type, $qualityBadgeHash)
    {
        return sprintf(
            '%s/%s/%s/%s?s=%s',
            $this->host,
            $type,
            $slug,
            'badges/quality-score.png',
            $qualityBadgeHash
        );
    }
44780
public static function iconUrlHandler($hook, $type, $url, $params) {

		$entity = elgg_extract('entity', $params);
		/* @var ElggEntity $entity */

		if ($entity instanceof Comment) {
			$owner = $entity->getOwnerEntity();
			if (!$owner) {
				return;
			}
			return $owner->getIconURL($params);
		}

		return $url;
	}
1124210
public function getDocumentTypeBySlug($slug, $getBricks = false)
    {
        $documentTypes = $this->repository->documentTypes;
        foreach ($documentTypes as $documentType) {
            if ($documentType->slug == $slug) {
                if ($getBricks === true) {
                    foreach ($documentType->bricks as $key => $brick) {
                        $brickStructure = $this->getBricks()->getBrickBySlug($brick->brickSlug);
                        $documentType->bricks[$key]->structure = $brickStructure;
                    }
                    foreach ($documentType->dynamicBricks as $key => $brickSlug) {
                        $brickStructure = $this->getBricks()->getBrickBySlug($brickSlug);
                        $documentType->dynamicBricks[$key] = $brickStructure;
                    }
                }

                return $documentType;
            }
        }

        return null;
    }
144342
protected function getUrl($type, $queries = array())
    {
        if ($type === 'news') {
            $api = self::API_FOREVER_NEWS_UPLOAD;
        } else {
            $api = $this->forever ? self::API_FOREVER_UPLOAD : self::API_TEMPORARY_UPLOAD;
        }

        return $api.'?'.http_build_query($queries);
    }
935835
public function getIdForSlug($slug, User $user = null)
    {
        $query = Tag::where('slug', 'like', $slug);

        return $this->scopeVisibleTo($query, $user)->pluck('id');
    }
727026
protected function buildKeysPath($type, $bucket)
    {
        if ($type === null) {
            return sprintf('/buckets/%s/keys', $bucket);
        }

        return sprintf('/types/%s/buckets/%s/keys', $type, $bucket);
    }
1280197
public function get_endpoint_url($type) {
        $endpoint = endpoint::get_record([
            'issuerid' => $this->get('id'),
            'name' => $type . '_endpoint'
        ]);

        if ($endpoint) {
            return $endpoint->get('url');
        }
        return false;
    }
821392
protected function generateGitkeep($type)
    {
        $slug = $this->data['slug'];

        if ($type == 'module') {
            $packagePath = $this->getModulePath($slug);

            $mode = 'module';
        } else if ($type == 'theme') {
            $packagePath = $this->getThemePath($slug);

            $mode = 'theme';
        } else {
            $packagePath = $this->getPackagePath($slug);

            $mode = $this->option('extended') ? 'extended' : 'default';
        }

        $packageFolders = $this->packageFolders[$mode];

        foreach ($packageFolders as $folder) {
            $path = $packagePath .$folder;

            //
            $files = $this->files->glob($path .'/*');

            if(! empty($files)) continue;

            $gitkeep = $path .DS .'.gitkeep';

            $this->files->put($gitkeep, '');
        }
    }
782962
private function uriConstruct($slug, $params) {
		$uri = self::API_HOST . '/' . $slug;
		if ($params) {
			$queryData = http_build_query($params);
			$uri .= '?' . $queryData;
		}

		return $uri;
	}
883057
protected function getArticleRouterPath($routeName, $type, $slug, $tagOrCategory, $locale, $parameters = [], $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH)
    {
        if (!$this->articleRouteExists($type, $locale)) {
            $routeName = '_slug';
        }
        if (!isset($parameters[$type])) {
            $parameters[$type] = $tagOrCategory;
        }
        if (!isset($parameters['url'])) {
            $parameters['url'] = $slug;
        }
        if (!isset($parameters['_locale'])) {
            $parameters['_locale'] = $locale;
        }

        return $this->router->generate($routeName, $parameters, $referenceType);
    }
150054
public function getModulePath($slug)
    {
        $module = studly_case($slug);

        if (\File::exists($this->getPath()."/{$module}/")) {
            return $this->getPath()."/{$module}/";
        }

        return $this->getPath()."/{$slug}/";
    }
315023
public function fetchId($type, $name)
    {
        return Inflector::dasherize($this->_parent->getName()) . '-' . Str::slug($type);
    }
283948
public function getHashingAlgorithm($type)
    {
        switch ($type) {
            case 'md5':
                return Password::MD5;

            case 'sha256':
                return Password::SHA256;

            case 'sha512':
                return Password::SHA512;

            case 'argon2':
                return Password::SODIUM_ARGON2;

            case 'scrypt':
                return Password::SODIUM_SCRYPT;

            case 'blowfish':
            case 'bf':
            default:
                return Password::BLOWFISH;
        }
    }
1262119
public function createGitattributesBadge($repository, $format = 'svg')
    {
        $repo = str_replace('.git', '', $this->packageRepository
            ->fetchByRepository($repository)
            ->getOriginalObject()
            ->getRepository()
        );

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

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

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

        return $this->createBadgeFromRepository(
            $repository,
            $subject,
            $color,
            $format
        );
    }
542429
public function stringify( $quality = null, $type = null ) 
	{
		ob_start(); $this->stream( $quality, $type ); return ob_get_clean();
	}
1201050
public function findVendorForSlug($slug)
    {
        return $this->em
            ->getRepository($this->vendorFqcn)
            ->findOneBy(array(
                'slug' => $slug,
                'organization' => $this->oh->getOrganization()
            ))
        ;
    }
1238680
public function cacheFile($type = 'jpg', $quality = 80, $actual = false, $extras = [])
    {
        if ($type === 'guess') {
            $type = $this->guessType();
        }

        if (!$this->forceCache && !count($this->operations) && $type === $this->guessType()) {
            return $this->getFilename($this->getFilePath());
        }

        // Computes the hash
        $this->hash = $this->getHash($type, $quality, $extras);

        // Seo friendly image names
        $seofriendly = Grav::instance()['config']->get('system.images.seofriendly', false);

        if ($seofriendly) {
            $mini_hash = substr($this->hash, 0, 4) . substr($this->hash, -4);
            $cacheFile = "{$this->prettyName}-{$mini_hash}";
        } else {
            $cacheFile = "{$this->hash}-{$this->prettyName}";
        }

        $cacheFile .= '.' . $type;

        // If the files does not exists, save it
        $image = $this;

        // Target file should be younger than all the current image
        // dependencies
        $conditions = array(
            'younger-than' => $this->getDependencies()
        );

        // The generating function
        $generate = function ($target) use ($image, $type, $quality) {
            $result = $image->save($target, $type, $quality);

            if ($result !== $target) {
                throw new GenerationError($result);
            }

            Grav::instance()->fireEvent('onImageMediumSaved', new Event(['image' => $target]));
        };

        // Asking the cache for the cacheFile
        try {
            $perms = Grav::instance()['config']->get('system.images.cache_perms', '0755');
            $perms = octdec($perms);
            $file = $this->getCacheSystem()->setDirectoryMode($perms)->getOrCreateFile($cacheFile, $conditions, $generate, $actual);
        } catch (GenerationError $e) {
            $file = $e->getNewFile();
        }

        // Nulling the resource
        $this->getAdapter()->setSource(new Source\File($file));
        $this->getAdapter()->deinit();

        if ($actual) {
            return $file;
        }

        return $this->getFilename($file);
    }