src/Behat/Behat/Context/ContextFactory.php
public function createContext($class, array $arguments = array(), array $singleUseResolvers = array())
    {
        $reflection = new ReflectionClass($class);
        $resolvers = array_merge($singleUseResolvers, $this->argumentResolvers);
        $resolvedArguments = $this->resolveArguments($reflection, $arguments, $resolvers);
        $context = $this->createInstance($reflection, $resolvedArguments);
        $this->initializeInstance($context);

        return $context;
    }
public function createContext($class, array $arguments = array(), array $singleUseResolvers = array())
    {
        $reflection = new ReflectionClass($class);
        $resolvers = array_merge($singleUseResolvers, $this->argumentResolvers);
        $resolvedArguments = $this->resolveArguments($reflection, $arguments, $resolvers);
        $context = $this->createInstance($reflection, $resolvedArguments);
        $this->initializeInstance($context);

        return $context;
    }
public function createContext ( $ class , array $ arguments = array ( ) , array $ singleUseResolvers = array ( ) ) { $ reflection = new ReflectionClass ( $ class ) ; $ resolvers = array_merge ( $ singleUseResolvers , $ this -> argumentResolvers ) ; $ resolvedArguments = $ this -> resolveArguments ( $ reflection , $ arguments , $ resolvers ) ; $ context = $ this -> createInstance ( $ reflection , $ resolvedArguments ) ; $ this -> initializeInstance ( $ context ) ; return $ context ; }
Creates and initializes context class.

@param string             $class
@param array              $arguments
@param ArgumentResolver[] $singleUseResolvers

@return Context
Creates and initializes context class .