Resolves single argument using container.

@param string $argument

@return mixed
328953
private function resolveArgument($argument)
    {
        if (is_array($argument)) {
            return array_map(array($this, 'resolveArgument'), $argument);
        }

        if (!is_string($argument)) {
            return $argument;
        }

        $container = $this->kernel->getContainer();
        $container = $container->has('test.service_container') ? $container->get('test.service_container') : $container;

        if ($service = $this->getService($container, $argument)) {
            return $service;
        }

        $resolvedParam = $this->replaceParameters($container, $argument);

        if (!is_string($resolvedParam)) {
            return $resolvedParam;
        }

        return $this->escape($resolvedParam);
    }
859983
protected function processArguments($arguments)
    {
        if (false === is_array($arguments)) {
            return $arguments;
        }

        return array_map(function ($argument) {
            return (string) $argument;
        }, $arguments);
    }
857787
final public function argument($key)
    {
        $result = null;

        foreach ($this->shellArguments as $shellArgument) {
            if ($shellArgument['key'] === $key) {
                $result = $shellArgument;

                break;
            }
        }

        return $result;
    }
706187
public static function resolve( $key )
	{
		if ( strpos( $key, '\\' ) !== false )
			return static::resolveClass( $key );

		$key = explode( '.', $key );

		if ( $resolver = static::getResolver( $key[0] ) )
			return $resolver->resolve( $key[0], implode( '.', array_slice( $key, 1 ) ) );

		return null;
	}
746604
public static function instance(Closure $callback = null, $argument = [])
    {
        if (!is_null($callback) && $callback instanceof Closure) {
            return $callback(static::getInstance($argument));
        }

        return static::getInstance($argument);
    }
946414
private function getDependencies(array $args, array &$arguments)
    {
        $objects = [];
        foreach ($arguments as $k => $v) {
            if (is_object($v)) {
                $objects[$k] = $v;
            }
        }

        $unShift = [];
        $args    = array_reverse($args);

        foreach ($args as $v) {
            $hasDefault = is_array($v);
            $dependency = $hasDefault ? $v[0] : $v;

            if ($objects) {
                $find = false;
                foreach ($objects as $k => $ins) {
                    if (! $ins instanceof $dependency) {
                        continue;
                    }

                    array_unshift($unShift, $ins);
                    unset($arguments[$k], $objects[$k]);

                    $find = true;
                    break;
                }

                if ($find) {
                    continue;
                }
            }

            $alias = $this->getDependencyAlias($dependency);
            if (! $alias) {
                if ($hasDefault) {
                    array_unshift($unShift, null);

                    continue;
                }

                throw new ContainerException("Unresolvable dependency resolving [{$dependency}]");
            }

            array_unshift($unShift, $this->get($alias));
        }
        unset($instance, $objects);

        $arguments = array_merge($unShift, $arguments);
        unset($unShift);
    }
181377
protected function escapeArgument($argument) : string
    {
        if (is_array($argument)) {
            $argument = array_map('escapeshellarg', $argument);
            $escaped  = implode(' ', $argument);
        } else {
            $escaped = escapeshellarg($argument);
        }
        return $escaped;
    }
261175
protected function getKeyArguments($arguments)
    {
        $keys = [];
        foreach ($arguments as $argument) {
            if (is_array($argument)) {
                $keys = array_merge($keys, $this->getKeyArguments($argument));
            }
            if (is_string($argument)) {
                $keys = array_merge($keys, $this->parseKeysString($argument));
            }
        }

        return $keys;
    }
379922
public function getNode(Argument $argument) : Expr
    {
        $dependencyIndex = (string) $argument;
        if (! $this->injector instanceof ScriptInjector) {
            return $this->getDefault($argument);
        }
        try {
            $isSingleton = $this->injector->isSingleton($dependencyIndex);
        } catch (NotCompiled $e) {
            return $this->getDefault($argument);
        }
        $func = $isSingleton ? 'singleton' : 'prototype';
        $args = $this->getInjectionProviderParams($argument);
        $node = new Expr\FuncCall(new Expr\Variable($func), $args);

        return $node;
    }
449053
protected function firstArgumentCorrespondsToPolicy(array $arguments)
    {
        if (! isset($arguments[0])) {
            return false;
        }

        $argument = $arguments[0];

        if (is_object($argument)) {
            $class = get_class($argument);

            return isset($this->policies[$class]);
        }

        return is_string($argument) && isset($this->policies[$argument]);
    }
232841
public function resolve(Container $container, array $args = [])
    {
        if ($this->resolvedDefinition && $this->shared === true) {
            return $this->resolvedDefinition;
        }

        $definitionResolver = new DefinitionResolver($container);
        $this->resolvedDefinition = $definitionResolver->resolver($this->definition, $args);
        $this->resolved = true;

        return $this->resolvedDefinition;
    }
1283750
public function removeArguments(array $arguments = null)
  {
    if ($this->isLocked()) {
      return $this->getObj()->removeArguments($arguments)->setLocked();
    } else {
      return parent::removeArguments($arguments);
    }
  }
341094
private function findBy($arguments)
    {
        $results = $this->select('*')->where($arguments[0], $arguments[1], $arguments[2])->findAll();

        if (is_null($results)) {
            return self::cyrus()->returnEmptyObject();
        }

        return $results;
    }
703953
protected function _rpcPreProcess($argument)
    {
        $this->affinity_key = null;
        if ($this->_affinity) {
            $command = $this->_affinity['command'];
            if ($command == self::BOUND || $command == self::UNBIND) {
                $this->affinity_key = $this->getAffinityKeyFromProto($argument);
            }
        }
        $this->channel_ref = $this->gcp_channel->getChannelRef($this->affinity_key);
        $this->channel_ref->activeStreamRefIncr();
        return $this->channel_ref;
    }
867377
public function blpop(...$arguments)
    {
        $result = $this->command('blpop', $arguments);

        return empty($result) ? null : $result;
    }
1193371
public function resolve( $key ) {
		$this->verifyBootstrap();

		if ( ! isset( $this->getContainer()[ $key ] ) ) {
			return null;
		}

		return $this->getContainer()[ $key ];
	}
582130
private function getDefault(Argument $argument) : Expr
    {
        if ($argument->isDefaultAvailable()) {
            $default = $argument->getDefaultValue();

            return ($this->normalizer)($default);
        }
        throw new Unbound($argument->getMeta());
    }