Attempts to resolve singular argument from container.

Convention is strings starting with `@` are considered services and
are expected to be present in the container.

@param mixed $value

@return mixed

@throws ContainerExceptionInterface
433397
private function resolveArgument($value)
    {
        if (is_string($value) && 0 === mb_strpos($value, '@')) {
            return $this->container->get(mb_substr($value, 1));
        }

        return $value;
    }
288326
public function resolve(
        ValueInterface $value,
        FixtureInterface $fixture,
        ResolvedFixtureSet $fixtureSet,
        array $scope,
        GenerationContext $context
    ): ResolvedValueWithFixtureSet {
        if (null === $this->argumentResolver) {
            throw ResolverNotFoundExceptionFactory::createUnexpectedCall(__METHOD__);
        }

        $arguments = $value->getArguments();
        foreach ($arguments as $index => $argument) {
            if ($argument instanceof ValueInterface) {
                $resolvedSet = $this->argumentResolver->resolve($argument, $fixture, $fixtureSet, $scope, $context);

                $arguments[$index] = $resolvedSet->getValue();
                $fixtureSet = $resolvedSet->getSet();
            }
        }

        return $this->resolver->resolve(
            new ResolvedFunctionCallValue($value->getName(), $arguments),
            $fixture,
            $fixtureSet,
            $scope,
            $context
        );
    }
910240
public function setCoreContainerSuffix($value)
    {
        $this->setFieldName('container_suffix');
        $this->loadObject(true);
        $this->setFieldValue($value);

        return $this;
    }
787464
public static function phpToXml($value)
    {
        switch (true) {
            case null === $value:
                return 'null';
            case true === $value:
                return 'true';
            case false === $value:
                return 'false';
            case $value instanceof Parameter:
                return '%'.$value.'%';
            case is_object($value) || is_resource($value):
                throw new RuntimeException('Unable to dump a service container if a parameter is an object or a resource.');
            default:
                return (string) $value;
        }
    }
779225
private function resolveComponent(&$value)
    {
        if (\is_string($value) && strpos($value, '@') === 0) {
            $value = $this->getComponent(substr($value, 1));
        }
    }
540973
protected function parseScope($value)
    {
        switch ($value) {
            case 'singleton':
                return Configuration::SCOPE_SINGLETON;
            case 'prototype':
                return Configuration::SCOPE_PROTOTYPE;
            case 'session':
                return Configuration::SCOPE_SESSION;
            default:
                throw new InvalidObjectConfigurationException('Invalid scope "' . $value . '"', 1167574991);
        }
    }
1315918
protected function resolveValue($value)
    {
        // clear
        $value = trim($value);

        // @key
        if(is_null($value) or $value == '') {
            return null;
        }
        // @key 10
        if(is_numeric($value)) {
            return $value + 0; // keeps type (int, float...)
        }
        // @key true
        elseif($value === 'true') {
            return true;
        }
        // @key false
        elseif($value === 'false') {
            return false;
        }
        // @key [value, value, value]
        elseif(preg_match('#^\[(.+)\]$#', $value, $out)) {
            $values = explode(',', $out[1]);
            $array = [];
            foreach($values as $item) {
                $array[] = $this->resolveValue($item);
            }
            return $array;
        }
        // @key {key: value, key: value}
        elseif(preg_match('#^\{(.+)\}$#', $value, $out)) {
            $props = explode(',', $out[1]);
            $object = [];
            foreach($props as $prop) {
                list($name, $item) = explode(':', $prop);
                $object[trim($name)] = $this->resolveValue($item);
            }
            return (object)$object;
        }
        // @key Some\Class
        elseif(false) {

        }
        // @key Some\Class(value, value, value)
        elseif(false) {

        }

        // @key 'value'
        return trim($value, '\'""');
    }
153682
protected function toNull($value)
    {
        if ($value === 0 || $value === false || $value === '') {
            return null;
        }
        if ($this->getTypeCheck()->isArray($value) && count($value) === 1) {
            return $this->toNull(reset($value));
        }

        return $value;
    }
172578
private function getClass($value)
    {
        if (\is_string($value)) {
            if (!class_exists($value) && !interface_exists($value, false)) {
                throw new InvalidArgumentException(sprintf('The class or interface "%s" does not exist.', $value));
            }

            return ltrim($value, '\\');
        }

        if (!\is_object($value)) {
            throw new InvalidArgumentException(sprintf('Cannot create metadata for non-objects. Got: "%s"', \gettype($value)));
        }

        return \get_class($value);
    }
708105
protected function instance(&$value)
    {
        foreach ($this->instances as &$tuple) {
            if ($tuple[0] === $value) {
                if (
                    is_array($value) &&
                    !$this->isArrayReference($tuple[0], $value)
                ) {
                    continue;
                }

                return $tuple[1];
            }
        }

        return null;
    }
230359
protected function processReference($value)
    {
        if ($this->isReference($value)) {
            
            list($class, $identifier) = $this->processTypedIdentifier($value);
            
            if (!$this->getFactory()->hasFixture($class, $identifier)) {
                
                throw new InvalidArgumentException(
                    sprintf(
                        'No fixture definition found for %s.%s',
                        $class,
                        $identifier
                    )
                );
                
            }
            
            return $this->getFactory()->getFixture($class, $identifier);
        }
    }
1012106
public static function resolve($value)
    {
        switch (strtolower($value)) {
            case self::NEWEST:
                return self::NEWEST;
            case self::AUTHORIZED:
                return self::AUTHORIZED;
            case self::NOT_AUTHORIZED:
                return self::NOT_AUTHORIZED;
            case self::PAID:
                return self::PAID;
            case 'canceled':
            case self::CANCELLED:
                return self::CANCELLED;
            case self::WAITING:
                return self::WAITING;
        }

        return null;
    }
134246
protected function transformValueContainer(Value\ValueContainerInterface $value)
    {
        if ($this->isVisited($value)) {
            return $value;
        }
        $this->setVisited($value);

        foreach ($value->keys() as $key) {
            if ($value->get($key) instanceof Value\PlaceholderValue) {
                $value->set($key, $value->get($key)->accept($this));
            }
            $value->set($key, $value->get($key)->accept($this));
        }

        return $value;
    }
872248
private static function parseReal($value)
    {
        if ($value == '') return null;

        $x = str_replace(',', '.', $value);
        if (static::isSignedReal($x)) return floatval($x);
        else throw new SyntaxErrorException();
    }
276820
public function asValue($value)
        {
            $endPoint =& $this->_getEndPoint();
            $endPoint['lookupType'] = self::TYPE_VALUE;
            $endPoint['value'] = $value;

            return $this;
        }
1343080
public function filter($value)
    {
        $filtered = null;
        if (!$this->validate($value, $filtered))
        {
            throw new \InvalidArgumentException(
                "Not a valid value for " . $this->__toString() . ": " . WF::str($value)
            );
        }

        return $filtered;
    }
765429
protected function resolveInstanceMethod($value)
	{
		$callable = explode('->', $value);
		$instantiator = $this->instantiator;
		$callable[0] = $instantiator($callable[0]);
		return function (...$params) use ($callable) {
			return call_user_func_array($callable, $params);
		};
	}