src/Behat/Behat/Context/ContextFactory.php
private function resolveArguments(ReflectionClass $reflection, array $arguments, array $resolvers)
    {
        $newArguments = $arguments;

        foreach ($resolvers as $resolver) {
            $newArguments = $resolver->resolveArguments($reflection, $newArguments);
        }

        if (!$reflection->hasMethod('__construct')) {
            return $newArguments;
        }

        $constructor = $reflection->getConstructor();
        $newArguments = $this->argumentOrganiser->organiseArguments($constructor, $newArguments);
        $this->validator->validateArguments($constructor, $newArguments);

        return $newArguments;
    }
private function resolveArguments(ReflectionClass $reflection, array $arguments, array $resolvers)
    {
        $newArguments = $arguments;

        foreach ($resolvers as $resolver) {
            $newArguments = $resolver->resolveArguments($reflection, $newArguments);
        }

        if (!$reflection->hasMethod('__construct')) {
            return $newArguments;
        }

        $constructor = $reflection->getConstructor();
        $newArguments = $this->argumentOrganiser->organiseArguments($constructor, $newArguments);
        $this->validator->validateArguments($constructor, $newArguments);

        return $newArguments;
    }
private function resolveArguments ( ReflectionClass $ reflection , array $ arguments , array $ resolvers ) { $ newArguments = $ arguments ; foreach ( $ resolvers as $ resolver ) { $ newArguments = $ resolver -> resolveArguments ( $ reflection , $ newArguments ) ; } if ( ! $ reflection -> hasMethod ( '__construct' ) ) { return $ newArguments ; } $ constructor = $ reflection -> getConstructor ( ) ; $ newArguments = $ this -> argumentOrganiser -> organiseArguments ( $ constructor , $ newArguments ) ; $ this -> validator -> validateArguments ( $ constructor , $ newArguments ) ; return $ newArguments ; }
Resolves arguments for a specific class using registered argument resolvers.

@param ReflectionClass    $reflection
@param array              $arguments
@param ArgumentResolver[] $resolvers

@return mixed[]
Resolves arguments for a specific class using registered argument resolvers .