Get service list.

@param string $tag
Tag.

@return array
Array of services.
508443
private function getServiceList($tag = null)
    {
        if ($tag) {
            return $this->getServiceListByTag($tag);
        }

        $services = [];
        $serviceDefinitions = $this->container->getDefinitions();

        foreach ($serviceDefinitions as $serviceId => $serviceDefinition) {
            $services[] = [$serviceId, $serviceDefinition->getClass()];
        }
        usort($services, [$this, 'compareService']);
        return $services;
    }
750135
public function getReleaseByTagName(string $tag): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/releases/tags/:tag',
            $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $tag));
    }
919095
public function checkIfTagMatchesRecords($tag)
    {
        // if tag list is empty, fetch them from the result list
        // otherwise use the cached result list
        if (!$this->tagsInSearchResult) {
            $this->tagsInSearchResult = $this->pObj->tagsInSearchResult = $this->db->getTagsFromSearchResult();
            $GLOBALS['TSFE']->fe_user->setKey('ses', 'ke_search.tagsInSearchResults', $this->tagsInSearchResult);
        }

        return array_key_exists($tag, $this->tagsInSearchResult);
    }
801519
public function getTags()
    {
        $tags = [];
        $this->caller->execute(TagCommand::getInstance($this)->listTags());
        foreach ($this->caller->getOutputLines() as $tagString) {
            if ($tagString != '') {
                $tags[] = new Tag($this, trim($tagString));
            }
        }

        return $tags;
    }
772588
public function getImagesByTag($tag = null)
    {
        $images = $this->model->orderBy('created_at', 'desc')->where('is_published', 1);

        if (!is_null($tag)) {
            $images->where('tags', 'LIKE', '%'.$tag.'%');
        }

        return $images;
    }
215798
public function getTags($name = null)
  {
    if (!$name) return $this->tags;
    
    return isset($this->tags[$name]) ? $this->tags[$name] : [];
  }
196739
protected function _normalizeTag($tag) {
		$namespace = null;
		$label = $tag;
		$separator = $this->getConfig('separator');
		if ($separator === null) {
			return [
				null,
				$tag,
			];
		}

		if (strpos($tag, $separator) !== false) {
			list($namespace, $label) = explode($separator, $tag);
		}

		return [
			trim($namespace),
			trim($label)
		];
	}
220576
public function findTaggedServices($tag, $orderByPriority = true)
    {
        $services = [];
        if (array_key_exists($tag, $this->servicesByTags)) {
            $services = $this->servicesByTags[$tag];
        }

        if ($orderByPriority) {
            $this->sortByPriority($services);
        }

        return $services;
    }
54482
public function getTag($tag) {
        if (isset($this->_tags[$tag])) {
            return $this->_tags[$tag];
        }

        throw new MissingFilterException(sprintf('No filter can be found with %s tag', $tag));
    }
110782
public function getTagItems(string $tag): array
    {
        $tagName = $this->getTagKey($tag);
        $keys    = $this->handler->sMembers($tagName);

        return array_map(function ($key) {
            return $this->getCacheKey($key);
        }, $keys);
    }
841552
public function getFieldAnnotationsContainingMatchingTag($tag) {
        $matchingAnnotations = array();
        foreach ($this->getFieldAnnotations() as $field => $fieldAnnotations) {
            if (isset($fieldAnnotations[$tag])) {
                $matchingAnnotations[$field] = $fieldAnnotations;
            }
        }

        return $matchingAnnotations;

    }
950203
public static function withTag($tag)
    {
        $element = (new ReflectionClass(static::class))->newInstanceWithoutConstructor();

        $element->tag = $tag;
        $element->attributes = new Attributes();
        $element->children = new Collection();

        return $element;
    }
908599
public function tagged($tag)
    {
        if (! isset($this->tags[$tag])) {
            return [];
        }

        return new RewindableGenerator(function () use ($tag) {
            foreach ($this->tags[$tag] as $abstract) {
                yield $this->make($abstract);
            }
        }, count($this->tags[$tag]));
    }
1328711
public function getEntry($tag)
    {
        if (isset($this->entries[$tag])) {
            return $this->entries[$tag];
        } else {
            return null;
        }
    }
372230
public function listServiceTypeData() {
    if (!isset($this->serviceTypesData)) {
      $this->serviceTypesData = $this->environment->getStorage()->retrieve('service_tag_types');
    }
    return $this->serviceTypesData;
  }
902461
public function getVotesList ($tag = null, bool $with = true) : array
    {
        return $this->_Votes->getVotesList(VoteUtil::tagsConvert($tag), $with);
    }
2450
public function getTaggedQuestions($tag)
    {
        $question = new Question($this->di->get("db"));

        $questions = $question->getQuestions();



        $filteredQuestions = array_filter($questions, function ($value) use ($tag) {
            return in_array($tag, $value->tags);
        });

        $views = [
            ["comment/question/view-all", ["questions" => $filteredQuestions,
             "headerTitle" => "Frågor med taggen $tag"], "main"]
        ];

        $this->di->get("pageRenderComment")->renderPage([
            "views" => $views,
            "title" => "Questions | $tag"
        ]);
    }