Get transport by name

@param $transportName
@return TransportInterface
@throws InvalidArgumentException
357660
public function getTransport($transportName)
    {
        if (empty($this->transport[$transportName])) {
            throw new InvalidArgumentException(sprintf('Transport %s not found', $transportName));
        }

        return $this->transport[$transportName];
    }
409580
public function getAdminConnection($name = null)
    {
        if (null === $name) {
            $name = $this->getDefaultConnectionName();
        }

        $serviceName = sprintf('doctrine_phpcr.admin.%s_session', $name);

        $connections = $this->getConnectionNames();
        if (!isset($connections[$name])) {
            throw new \InvalidArgumentException(sprintf('Doctrine %s Connection named "%s" does not exist.', $this->getName(), $name));
        }

        return $this->getService($serviceName);
    }
222536
public function getProvider(string $name) : string
    {
        $providers = $this->getProviders();
        if (!in_array($name, array_keys($providers))) {
            throw new InvalidArgumentException("Provider for [$name] is not configured");
        }

        return $providers[$name];
    }
1086432
public static function getByName($name)
    {
        $name = (string)$name;
        $class = get_called_class();
        if (isset(self::$instances[$class][$name])) {
            return self::$instances[$class][$name];
        }
        $const = $class . '::' . $name;
        if (!defined($const)) {
            throw new \InvalidArgumentException($const . ' not defined');
        }
        return self::$instances[$class][$name] = new $class(constant($const));
    }
1102163
public function get($name)
    {
        if (!array_key_exists($name, $this->options)) {
            throw new \InvalidArgumentException(sprintf('The option "%s" does not exist.', $name));
        }

        return $this->options[$name];
    }
481419
public function setTransport(TransportInterface $transport)
    {
        if (!$transport instanceof CurlTransport) {
            throw new \InvalidArgumentException(
                sprintf(
                    '%s only supports %s',
                    get_called_class(),
                    CurlTransport::class
                )
            );
        }

        $this->transport = $transport;

        return $this;
    }
826563
public function getConnection($name)
    {
        if (!$this->connectionSettings->has($name)) {
            throw new BadArgumentException('Connection with name ":name" not defined in configuration file ":file"', [
                'name' => $name, 'file' => ServiceLocator::instance()->getConfiguration()->getIdentity(),
            ]);
        }
        
        $this->connect($name);
        
        return static::$connections[$name];
    }
78340
public function getStorage($name)
    {
        $class = sprintf('\\MwbExporter\\Storage\\%sStorage', ucfirst($name));
        if (class_exists($class)) {
            $storage = new $class();

            return $storage;
        }

        throw new \InvalidArgumentException(sprintf('Storage %s not found.', $class));
    }
295274
public function getRoute($name)
    {
        if (empty($name)) {
            throw new \InvalidArgumentException("Route name not provided.");
        }

        // TODO: This is not very efficient, maybe find a better way
        foreach ($this->routes as $route) {
            if ($route->getName() === $name) {
                return $route;
            }
        }

        throw new \Exception("Route \"$name\" not found.");
    }
20791
public function getRouteFromName(string $routeName) : ?RouteInterface
    {
        foreach ($this->routes as $route) {
            if ($route->getName() == $routeName) {
                return $route;
            }
        }
        return null;
    }
1071376
public function get($name)
    {
        if (!isset($this->helpers[$name])) {
            throw new \InvalidArgumentException(sprintf('The helper "%s" is not defined.', $name));
        }

        return $this->helpers[$name];
    }
233543
public function getRoute($actionName)
    {
        if (array_key_exists($actionName, $this->routes)){
            return $this->routes[$actionName];
        }
        return false;
    }
934309
public static function get($name)
    {
        if (!isset(static::$types[$name])) {
            if (!static::has($name)) {
                throw new \InvalidArgumentException(sprintf('The type "%s" does not exists.', $name));
            }

            static::$types[$name] = new static::$map[$name];
        }

        return static::$types[$name];
    }
1190430
def get_transport(name):
    '''
    
    '''
    try:
        log.debug('Using %s as transport', name)
        return TRANSPORT_LOOKUP[name]
    except KeyError:
        msg = 'Transport {} is not available. Are the dependencies installed?'.format(name)
        log.error(msg, exc_info=True)
        raise InvalidTransportException(msg)
714966
public function getNamedRoute(string $name) : Route
    {
        $this->buildNameIndex();

        if (isset($this->namedRoutes[$name])) {
            return $this->namedRoutes[$name];
        }

        throw new InvalidArgumentException(sprintf('No route of the name (%s) exists', $name));
    }
345046
public function get($name)
    {
        if ($this->cache->has($name)) {
            return $this->loader->load($this->cache->get($name));
        }

        if (!$this->cache->isFresh()) {
            $this->refresh();

            return $this->get($name);
        }

        throw new \InvalidArgumentException(sprintf(
            'Unknown resource named "%s" for the host "%s"',
            $name,
            $this->host
        ));
    }
637375
public function getProvider($name)
    {
        if (!$name) {
            throw new \InvalidArgumentException('Provider name cannot be empty, did you forget to call setProviderName() in your Media object?');
        }
        if (empty($this->providers)) {
            throw new \RuntimeException(sprintf('Unable to retrieve provider named "%s" since there are no providers configured yet.', $name));
        }
        if (!isset($this->providers[$name])) {
            throw new \InvalidArgumentException(sprintf('Unable to retrieve the provider named "%s". Available providers are %s.', $name, '"'.implode('", "', $this->getProviderList()).'"'));
        }

        return $this->providers[$name];
    }