@param $name
@param  int                          $mode
@return false|null|ArgumentInterface

@throws \IndexEngine\Driver\Exception\InvalidNameException

This method return an argument with its name
359480
public function getArgument($name, $mode = self::MODE_THROW_EXCEPTION_ON_ERROR)
    {
        $this->checkGetMode($mode, __METHOD__);

        if (false === $this->hasArgument($name)) {
            if ($mode === static::MODE_THROW_EXCEPTION_ON_ERROR) {
                throw new InvalidNameException(sprintf("The argument name '%s' doesn't exist", $name));
            } elseif ($mode === static::MODE_RETURN_BOOLEAN) {
                return false;
            } elseif ($mode === static::MODE_RETURN_NULL) {
                return;
            }
        }

        return $this->collection[$name];
    }
1122201
public function getFullRouteUrlByName($name, array $parameters = [])
    {
        $routeUrl = $this->router->getRouteUrlByName($name, $parameters);
        if ($routeUrl === null) {
            return null;
        }
        return $this->url->getUrl($routeUrl);
    }
1306104
public function getNamedRoute(string $name): Route
    {
        foreach ($this->getRoutes() as $route) {
            if ($route->getName() === $name) {
                return $route;
            }
        }

        throw new InvalidArgumentException('Named route does not exist for name: ' . $name);
    }
793729
public function getArgumentByName(string $name)
    {
        $param = self::$params[$this->className][$this->method];

        if (!isset($param[$name])) {
            return null;
        }

        return $this->arguments[$param[$name]['index']];
    }
248906
public function setRequestMode($mode)
    {
        if (!in_array($mode, ['real', 'simu'])) {
            $message = sprintf(
              'The request mode %s is not supported, real or simu expected!',
              $mode
            );
            throw new \InvalidArgumentException($message, 500);
        }
        $this->params['request_mode'] = $mode;
        return $this;
    }
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];
    }
1222607
public function getConfigurator(string $name): FieldSetConfigurator
    {
        if (!isset($this->configurators[$name])) {
            if (isset($this->serviceIds[$name])) {
                $configurator = $this->container->get($this->serviceIds[$name]);
            } elseif (class_exists($name)) {
                // Support fully-qualified class names.
                $configurator = new $name();
            } else {
                throw new InvalidArgumentException(sprintf('Could not load FieldSet configurator "%s".', $name));
            }

            if (!$configurator instanceof FieldSetConfigurator) {
                throw new InvalidArgumentException(sprintf('Configurator class "%s" is expected to be an instance of '.FieldSetConfigurator::class, $name));
            }

            $this->configurators[$name] = $configurator;
        }

        return $this->configurators[$name];
    }
399601
public function has($key, $mode = self::HAS_EXISTS)
    {
        $key = $this->normalizeKey($key);

        switch ($mode) {
            case self::HAS_EXISTS:
                return array_key_exists($key, $this->data);

            case self::HAS_ISSET:
                return isset($this->data[$key]);

            case self::HAS_NONEMPTY:
                return !empty($this->data[$key]);

            case self::HAS_LENGTH:
                return isset($this->data[$key]) && strlen($this->data[$key]);

            default:
                throw new InvalidArgumentException("Mode {$mode} not supported");
        }
    }
683887
public function argument($name, $mode = null, $description = '', $default = null)
    {
        $argument = new InputArgument($name, $mode, $description, $default);
        $this->addArgument($argument);

        return $this;
    }
439324
public function getArgument($name) {
        if (!$this->docoptResult)
            return null;

        if ($this->isArgument($name)) {
            $value = $this->docoptResult[$name];
            if (is_array($value))
                return $value ? $value[0] : null;
            return $value;
        }
        return null;
    }
733349
public function setMode($mode)
    {
        if (!in_array($mode, [
            GetOpt::NO_ARGUMENT,
            GetOpt::OPTIONAL_ARGUMENT,
            GetOpt::REQUIRED_ARGUMENT,
            GetOpt::MULTIPLE_ARGUMENT,
        ], true)) {
            throw new \InvalidArgumentException(sprintf(
                'Option mode must be one of %s, %s, %s and %s',
                'GetOpt::NO_ARGUMENT',
                'GetOpt::OPTIONAL_ARGUMENT',
                'GetOpt::REQUIRED_ARGUMENT',
                'GetOpt::MULTIPLE_ARGUMENT'
            ));
        }
        $this->mode = $mode;
        return $this;
    }
715066
public function addDirectory($name, $mode = 0777) {
        if (is_null($name)) {
            return $this;
        }
        $dir = $this->getChild($name);
        if (!is_dir($dir)) {
            mkdir($dir, $mode);
        }
        return new Directory($dir);
    }
716630
public function supportPortalMethod( $name, $method )
	{
		if( $name instanceof Module )
		{
			$name = $name->getKey();
		}

		return $this->module->support($name) && method_exists($this, $method);
	}
1326705
public function getParam ($name)
		{
			if (isset( $this->_params[ $name ] ))
				return $this->_params[ $name ];
			else
				return null;
		}
1001171
public function addArg(string $name, int $mode = null, string $description = '', $default = null): self
    {
        return $this->addArgument($name, $mode, $description, $default);
    }
1004725
public function format($mode, $name, $data)
    {
        if ($mode === 'cast') {
            throw new InvalidArgumentException("Use `Schema::cast()` to perform casting.");
        }
        if (!isset($this->_columns[$name])) {
            // Formatting non defined columns or relations doesn't make sense, bailing out.
            return $this->convert($mode, '_default_', $data, []);
        }
        $column = $this->_columns[$name];
        $isNull = $data === null;
        $type = $isNull ? 'null' : $this->type($name);

        if (!$column['array']) {
            $data = $this->convert($mode, $type, $data, $column);
        } else {
            $data = Collection::format($mode, $data);
        }
        if (!$isNull && !empty($column['format'])) {
            $data = $this->convert($mode, $column['format'], $data, $column);
        }
        return $data;
    }
241466
protected function load($name)
    {
        if ($name instanceof Template) {
            return $name;
        }

        try {
            return $this->environment->loadTemplate((string) $name);
        } catch (LoaderError $e) {
            throw new \InvalidArgumentException($e->getMessage(), $e->getCode(), $e);
        }
    }