Gets the manager class for the given environment.

@param string $name Environment Name
@throws \InvalidArgumentException
@return \Phinx\Migration\Manager\Environment
517448
public function getEnvironment($name)
    {
        if (isset($this->environments[$name])) {
            return $this->environments[$name];
        }

        // check the environment exists
        if (!$this->getConfig()->hasEnvironment($name)) {
            throw new \InvalidArgumentException(sprintf(
                'The environment "%s" does not exist',
                $name
            ));
        }

        // create an environment instance and cache it
        $envOptions = $this->getConfig()->getEnvironment($name);
        $envOptions['version_order'] = $this->getConfig()->getVersionOrder();

        $environment = new Environment($name, $envOptions);
        $this->environments[$name] = $environment;
        $environment->setInput($this->getInput());
        $environment->setOutput($this->getOutput());

        return $environment;
    }
453494
public function getBehavior($name)
    {
        /** @var \Cake\ORM\Behavior $behavior */
        $behavior = $this->_behaviors->get($name);
        if ($behavior === null) {
            throw new InvalidArgumentException(sprintf(
                'The %s behavior is not defined on %s.',
                $name,
                get_class($this)
            ));
        }

        return $behavior;
    }
1244060
public function getHandler($name) {
        if (!isset($this->instances[$name])) {
            $handlerClass = __NAMESPACE__ . '\\' . $name;
            $this->instances[$name] = new $handlerClass($this->builder);
        }
        return $this->instances[$name];
    }
1193560
public function get(string $name = null): \TheCMSThread\Classes\Plugin
    {
        if (empty($name) === false && empty($this->plugins[$name]) === false) {
            return $this->plugins[$name];
        } else {
            throw new \InvalidArgumentException("Plugin not found");
        }
    }
103951
public function get($name)
    {
        switch ($name) {
            case '_':
                return $this->returnValue;

            case '_e':
                if (isset($this->lastException)) {
                    return $this->lastException;
                }
                break;

            case '__out':
                if (isset($this->lastStdout)) {
                    return $this->lastStdout;
                }
                break;

            case 'this':
                if (isset($this->boundObject)) {
                    return $this->boundObject;
                }
                break;

            case '__function':
            case '__method':
            case '__class':
            case '__namespace':
            case '__file':
            case '__line':
            case '__dir':
                if (\array_key_exists($name, $this->commandScopeVariables)) {
                    return $this->commandScopeVariables[$name];
                }
                break;

            default:
                if (\array_key_exists($name, $this->scopeVariables)) {
                    return $this->scopeVariables[$name];
                }
                break;
        }

        throw new \InvalidArgumentException('Unknown variable: $' . $name);
    }
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];
    }
562820
public function get($name)
    {
        $tid = $this->getTid($name);
        if (!isset($this->_containers[$tid])) {
            $this->_containers[$tid] = new Container([
                'manager' => $this,
            ]);
        }
        return $this->_containers[$tid]->get($name);
    }
824628
public function get($name)
    {
        $toggle = $this->collection->get($name);
        if(!$toggle){
            throw new \InvalidArgumentException("Cannot find Toggle with name $name");
        }

        return $toggle;
    }
335895
public function getJob(string $name): Definition
    {
        if (!$this->hasJob($name)) {
            throw new \InvalidArgumentException('Job not found: ' . $name);
        }

        return $this->jobs[$name];
    }
997678
public function get($name)
    {
        $this->checkNameIsString($name);

        if (isset($this->encrypters[$name])) {
            $encrypter = $this->encrypters[$name];
        } else {
            if (isset($this->configs[$name])) {
                $config = $this->configs[$name];
                $encrypter = new ManagedEncrypter($config);

                $this->encrypters[$name] = $encrypter;
            } else {
                throw new \InvalidArgumentException('Unknown encrypter (' . $name . ')');
            }
        }

        return $encrypter;
    }
617004
public function getRole($name)
    {
        if ($this->hasRole($name)) {
            return $this->roles[$name];
        }

        throw new \InvalidArgumentException(sprintf('No role with name "%s" could be found', $name));
    }
1228946
public function get($name)
    {
        if (!isset($this->engines[$name])) {
            throw new \InvalidArgumentException('Template engine "'.$name.'" is not known or registered');
        }

        return $this->engines[$name];
    }
273839
public function find($name)
    {
        if ($this->is_registered($name)) {
            return $this->items[$name];
        }
        $model = $this->adaptor->getModel($name);
        if ($model) {
            return $model;
        }
        throw new \InvalidArgumentException("{$name} not registered");
    }
481212
public function getField($name)
    {
        if ($this->has($name)) {
            return $this->fields[$name];
        }

        throw new \InvalidArgumentException(
            'Field with name ['. $name .'] does not exist in class '.get_class($this)
        );
    }
854399
protected function getCacheConfig(string $name)
    {
        $cache = $this->config->get($this->getConfigName().'.cache');

        if (!is_array($config = array_get($cache, $name)) && !$config) {
            throw new InvalidArgumentException("Cache [$name] not configured.");
        }

        $config['name'] = $name;

        return $config;
    }
416971
public function env($name)
    {
        return isset($this->_envs[$name])
            ? $this->_envs[$name]
            : null;
    }
905822
public static function get($name)
    {
        if (self::$options & self::USE_ENV_ARRAY) {
            $value = isset($_ENV[$name]) ? $_ENV[$name] : false;
        } elseif (self::$options & self::LOCAL_FIRST) {
            $value = getenv($name, true);

            if ($value === false) {
                $value = getenv($name);
            }
        } else {
            $value = getenv($name);
        }

        if ($value === false) {
            return self::$default;
        }

        return self::convert($value);
    }