public function getTagsByName(string $name): array
    {
        $result = [];

        /** @var Tag $tag */
        foreach ($this->getTags() as $tag) {
            if ($tag->getName() !== $name) {
                continue;
            }

            $result[] = $tag;
        }

        return $result;
    }
public function getTagsByName(string $name): array
    {
        $result = [];

        /** @var Tag $tag */
        foreach ($this->getTags() as $tag) {
            if ($tag->getName() !== $name) {
                continue;
            }

            $result[] = $tag;
        }

        return $result;
    }
public function getTagsByName ( string $ name ) : array { $ result = [ ] ; /** @var Tag $tag */ foreach ( $ this -> getTags ( ) as $ tag ) { if ( $ tag -> getName ( ) !== $ name ) { continue ; } $ result [ ] = $ tag ; } return $ result ; }
Returns an array of tags matching the given name. If no tags are found
an empty array is returned.

@param string $name String to search by.

@return Tag[]
Returns an array of tags matching the given name . If no tags are found an empty array is returned .