Get a response from the transformer tags.

@param array $tags

@return array|null
183210
protected function getTransformerResponse(array $tags)
    {
        try {
            if (empty($transformerTag = $this->getTransformerTag($tags))) {
                return;
            }

            $transformer = $this->getTransformerClass($transformerTag);
            $model = $this->getClassToBeTransformed($tags, (new ReflectionClass($transformer))->getMethod('transform'));
            $modelInstance = $this->instantiateTransformerModel($model);

            $fractal = new Manager();

            if (! is_null(config('apidoc.fractal.serializer'))) {
                $fractal->setSerializer(app(config('apidoc.fractal.serializer')));
            }

            $resource = (strtolower($transformerTag->getName()) == 'transformercollection')
                ? new Collection([$modelInstance, $modelInstance], new $transformer)
                : new Item($modelInstance, new $transformer);

            return [response($fractal->createData($resource)->toJson())];
        } catch (\Exception $e) {
            return;
        }
    }
475303
protected function getFormattedTags(array $tags)
    {
        $add =array();

        foreach ($tags as $key => $value) {
            if (is_bool($value)) {
                $value = $value ? "true" : "false";
            }
            $add[] = "#$key:$value";
        }

        return !empty($add) ? '|'.implode(',', $add) : null;
    }
803783
public function processTags($tags = null)
    {
        if (empty($tags)) {
            $tags = $this->tags;
        }
        foreach ($tags as $tag) {
            $this->tags[] = $tag;
            if (preg_match('/[A-Z]+\-[\d]+/', $tag)) {
                $this->setTicket($tag);
                continue;
            }
            if ($tag == 'Jira') {
                $this->setLogged(true);
            }
        }
        $this->tags = array_unique($this->tags);
    }
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;
    }
904380
protected function getClassesTaggedWith(array $tags)
    {
        $classes = [];

        foreach ($this->state->annotations as $annotation) {
            if (!$annotation instanceof Tag || !in_array($annotation->value, $tags, true)) {
                continue;
            }

            $classes[] = $annotation->originClass;
        }

        return $classes;
    }
583271
private function getTags(): array
    {
        $tags = [];
        foreach ($this->referenceStorePool->getStores() as $alias => $referenceStore) {
            $tags = array_merge($tags, $this->getTagsFromStore($alias, $referenceStore));
        }

        return $tags;
    }
879126
public function get(string $key, array $tags)
    {
        return $this->cache->tags($tags)->get($key);
    }
1332949
public function findOrCreate(array $tags)
    {
        $foundTags = $this->findWhereIn(['tag', $tags]);

        $returnTags = [];

        if ($foundTags) {
            foreach ($foundTags as $tag) {
                $pos = array_search($tag->tag, $tags);

                // Add returned tags to array
                if ($pos !== false) {
                    $returnTags[] = $tag;
                    unset($tags[$pos]);
                }
            }
        }

        // Add remainings tags as new
        foreach ($tags as $tag) {
            $returnTags[] = $this->create([
                'tag' => $tag,
                'slug' => Str::slug($tag),
            ]);
        }

        return $returnTags;
    }
1301825
protected function checkCacheTags(array $tags)
    {
        $invalidTags = array_diff(array_keys($tags), ['tagId', 'tagKeyword']);
        if (count($invalidTags) > 0) {
            throw new InvalidArgumentException(
                'cacheTags',
                'Unknown cache tag(s): ' . implode(', ', $invalidTags)
            );
        }

        return $tags;
    }
322745
protected function getAuthStatusFromDocBlock(array $tags)
    {
        $authTag = collect($tags)
            ->first(function ($tag) {
                return $tag instanceof Tag && strtolower($tag->getName()) === 'authenticated';
            });

        return (bool) $authTag;
    }
122632
protected function getDocBlockResponses(array $tags)
    {
        $responseTags = array_values(
            array_filter($tags, function ($tag) {
                return $tag instanceof Tag && strtolower($tag->getName()) === 'response';
            })
        );

        if (empty($responseTags)) {
            return;
        }

        return array_map(function (Tag $responseTag) {
            preg_match('/^(\d{3})?\s?([\s\S]*)$/', $responseTag->getContent(), $result);

            $status = $result[1] ?: 200;
            $content = $result[2] ?: '{}';

            return new JsonResponse(json_decode($content, true), (int) $status);
        }, $responseTags);
    }
756274
public function setTags($tags)
    {
        $this->tags = [];
        $this->ref = null;

        if (is_array($tags)) {
            foreach ($tags as $tag) {
                $this->addTag($tag);
            }
        } else {
            $this->addTag($tags);
        }

        return $this;
    }
1072849
public function getTokenParser($tag)
    {
        if (isset($this->parsers[$tag])) {
            return $this->parsers[$tag];
        }
        $broker = end($this->brokers);
        while (false !== $broker) {
            $parser = $broker->getTokenParser($tag);
            if (null !== $parser) {
                return $parser;
            }
            $broker = prev($this->brokers);
        }
    }
474973
public static function get_tags($tags) {
        global $CFG, $PAGE, $DB;

        // Validate and normalize parameters.
        $tags = self::validate_parameters(self::get_tags_parameters(), array('tags' => $tags));

        $systemcontext = context_system::instance();
        self::validate_context($systemcontext);

        $canmanage = has_capability('moodle/tag:manage', $systemcontext);
        $canedit = has_capability('moodle/tag:edit', $systemcontext);

        $return = array();
        $warnings = array();

        if (empty($CFG->usetags)) {
            throw new moodle_exception('tagsaredisabled', 'tag');
        }

        $renderer = $PAGE->get_renderer('core');
        foreach ($tags['tags'] as $tag) {
            $tag = (array)$tag;
            if (!$tagobject = $DB->get_record('tag', array('id' => $tag['id']))) {
                $warnings[] = array(
                    'item' => $tag['id'],
                    'warningcode' => 'tagnotfound',
                    'message' => get_string('tagnotfound', 'error')
                );
                continue;
            }
            $tagoutput = new \core_tag\output\tag($tagobject);
            // Do not return some information to users without permissions.
            $rv = $tagoutput->export_for_template($renderer);
            if (!$canmanage) {
                if (!$canedit) {
                    unset($rv->isstandard);
                    unset($rv->official);
                }
                unset($rv->flag);
            }
            $return[] = $rv;
        }
        return array('tags' => $return, 'warnings' => $warnings);
    }
1117656
protected function getBodyParametersFromDocBlock(array $tags)
    {
        $parameters = collect($tags)
            ->filter(function ($tag) {
                return $tag instanceof Tag && $tag->getName() === 'bodyParam';
            })
            ->mapWithKeys(function ($tag) {
                preg_match('/(.+?)\s+(.+?)\s+(required\s+)?(.*)/', $tag->getContent(), $content);
                if (empty($content)) {
                    // this means only name and type were supplied
                    list($name, $type) = preg_split('/\s+/', $tag->getContent());
                    $required = false;
                    $description = '';
                } else {
                    list($_, $name, $type, $required, $description) = $content;
                    $description = trim($description);
                    if ($description == 'required' && empty(trim($required))) {
                        $required = $description;
                        $description = '';
                    }
                    $required = trim($required) == 'required' ? true : false;
                }

                $type = $this->normalizeParameterType($type);
                list($description, $example) = $this->parseDescription($description, $type);
                $value = is_null($example) ? $this->generateDummyValue($type) : $example;

                return [$name => compact('type', 'description', 'required', 'value')];
            })->toArray();

        return $parameters;
    }
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));
    }
1059730
public static function serializeTags(array $tags)
    {
        if (empty($tags))
            return '';

        self::validateTags($tags);
        $tagstrs = array();
        foreach ($tags as $tag)
            $tagstrs[] = $tag->toString(true);

        return implode(';', $tagstrs);
    }