src/GraphQL/Utils.php
protected static function construct(ExecutionContext $exeContext = null): Executor
    {
        $executorReflection = new \ReflectionClass(Executor::class);
        /** @var Executor $executor */
        $executor = $executorReflection->newInstanceWithoutConstructor();

        if ($exeContext !== null) {
            $constructor = $executorReflection->getConstructor();
            $constructor->setAccessible(true);
            $constructor->invoke($executor, $exeContext);
        }

        return $executor;
    }
protected static function construct(ExecutionContext $exeContext = null): Executor
    {
        $executorReflection = new \ReflectionClass(Executor::class);
        /** @var Executor $executor */
        $executor = $executorReflection->newInstanceWithoutConstructor();

        if ($exeContext !== null) {
            $constructor = $executorReflection->getConstructor();
            $constructor->setAccessible(true);
            $constructor->invoke($executor, $exeContext);
        }

        return $executor;
    }
protected static function construct ( ExecutionContext $ exeContext = null ) : Executor { $ executorReflection = new \ ReflectionClass ( Executor :: class ) ; /** @var Executor $executor */ $ executor = $ executorReflection -> newInstanceWithoutConstructor ( ) ; if ( $ exeContext !== null ) { $ constructor = $ executorReflection -> getConstructor ( ) ; $ constructor -> setAccessible ( true ) ; $ constructor -> invoke ( $ executor , $ exeContext ) ; } return $ executor ; }
Some crazy stuff to work around a private constructor

@param ExecutionContext $exeContext
@return Executor
Some crazy stuff to work around a private constructor