Eloquent\Phony\Spy\GeneratorSpyFactory::create PHP Метод

create() публичный Метод

Create a new generator spy.
public create ( Eloquent\Phony\Call\Call $call, Generator $generator ) : Generator
$call Eloquent\Phony\Call\Call The call from which the generator originated.
$generator Generator The generator.
Результат Generator The newly created generator spy.
    public function create(Call $call, Generator $generator)
    {
        if ($this->isHhvm) {
            // @codeCoverageIgnoreStart
            if ($this->isGeneratorReturnSupported) {
                $spy = GeneratorSpyFactoryDetailHhvmWithReturn::createGeneratorSpy($call, $generator, $this->callEventFactory);
            } else {
                $spy = GeneratorSpyFactoryDetailHhvm::createGeneratorSpy($call, $generator, $this->callEventFactory, $this->isGeneratorImplicitNextSupported);
            }
            // @codeCoverageIgnoreEnd
        } elseif ($this->isGeneratorReturnSupported) {
            $spy = GeneratorSpyFactoryDetailPhpWithReturn::createGeneratorSpy($call, $generator, $this->callEventFactory);
            // @codeCoverageIgnoreStart
        } else {
            $spy = GeneratorSpyFactoryDetailPhp::createGeneratorSpy($call, $generator, $this->callEventFactory);
        }
        // @codeCoverageIgnoreEnd
        $spy->_phonySubject = $generator;
        return $spy;
    }