src/Behat/Symfony2Extension/Context/Argument/ServiceArgumentResolver.php
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);
    }
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);
    }
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 ) ; }
Resolves single argument using container.

@param string $argument

@return mixed
Resolves single argument using container .