src/Behat/Behat/HelperContainer/BuiltInServiceContainer.php
private function createInstance($id)
    {
        $schema = $this->getAndValidateServiceSchema($id);

        $reflection = new ReflectionClass($schema['class']);
        $arguments = $schema['arguments'];

        if ($factoryMethod = $this->getAndValidateFactoryMethod($reflection, $schema)) {
            return $factoryMethod->invokeArgs(null, $arguments);
        }

        return $reflection->newInstanceArgs($arguments);
    }
private function createInstance($id)
    {
        $schema = $this->getAndValidateServiceSchema($id);

        $reflection = new ReflectionClass($schema['class']);
        $arguments = $schema['arguments'];

        if ($factoryMethod = $this->getAndValidateFactoryMethod($reflection, $schema)) {
            return $factoryMethod->invokeArgs(null, $arguments);
        }

        return $reflection->newInstanceArgs($arguments);
    }
private function createInstance ( $ id ) { $ schema = $ this -> getAndValidateServiceSchema ( $ id ) ; $ reflection = new ReflectionClass ( $ schema [ 'class' ] ) ; $ arguments = $ schema [ 'arguments' ] ; if ( $ factoryMethod = $ this -> getAndValidateFactoryMethod ( $ reflection , $ schema ) ) { return $ factoryMethod -> invokeArgs ( null , $ arguments ) ; } return $ reflection -> newInstanceArgs ( $ arguments ) ; }
Creates an instance of given service.

@param string $id

@return mixed
Creates an instance of given service .