public function getName(string $code): string
    {
        $result = $code;

        if (empty($code)) {
            throw new InvalidArgumentException("Code must be a non-empty string.");
        }

        $languages = $this->getSupported();
        if (!empty($languages[$code])) {
            $result = $languages[$code];
        }

        return $result;
    }
public function getName(string $code): string
    {
        $result = $code;

        if (empty($code)) {
            throw new InvalidArgumentException("Code must be a non-empty string.");
        }

        $languages = $this->getSupported();
        if (!empty($languages[$code])) {
            $result = $languages[$code];
        }

        return $result;
    }
public function getName ( string $ code ) : string { $ result = $ code ; if ( empty ( $ code ) ) { throw new InvalidArgumentException ( "Code must be a non-empty string." ) ; } $ languages = $ this -> getSupported ( ) ; if ( ! empty ( $ languages [ $ code ] ) ) { $ result = $ languages [ $ code ] ; } return $ result ; }
Get language name by code

@throws \InvalidArgumentException when code is not a string
@param string $code Language code to lookup
@return string
Get language name by code