public static function byName(
        Client $client,
        string $name
    ): self {
        $tags = self::byNames(
            $client,
            [$name],
            self::ORDER_NAME,
            //            null,
            false
        );

        if (count($tags) === 0) {
            throw new TagNotFoundException(sprintf(
                'Tag with name %s not found',
                $name
            ));
        }

        return $tags[0];
    }
public static function byName(
        Client $client,
        string $name
    ): self {
        $tags = self::byNames(
            $client,
            [$name],
            self::ORDER_NAME,
            //            null,
            false
        );

        if (count($tags) === 0) {
            throw new TagNotFoundException(sprintf(
                'Tag with name %s not found',
                $name
            ));
        }

        return $tags[0];
    }
public static function byName ( Client $ client , string $ name ) : self { $ tags = self :: byNames ( $ client , [ $ name ] , self :: ORDER_NAME , //            null, false ) ; if ( count ( $ tags ) === 0 ) { throw new TagNotFoundException ( sprintf ( 'Tag with name %s not found' , $ name ) ) ; } return $ tags [ 0 ] ; }
Search tag by name or throw exception if nothing found.

@param Client $client
@param string $name

@throws TagNotFoundException if tag not found

@return Tag
Search tag by name or throw exception if nothing found .