createGeneratorSpy() публичный статический Метод

Create a new generator spy.
public static createGeneratorSpy ( Eloquent\Phony\Call\Call $call, Generator $generator, CallEventFactory $callEventFactory, boolean $isGeneratorImplicitNextSupported ) : Generator
$call Eloquent\Phony\Call\Call The call from which the generator originated.
$generator Generator The generator.
$callEventFactory Eloquent\Phony\Call\Event\CallEventFactory The call event factory to use.
$isGeneratorImplicitNextSupported boolean True if implicit generator next() behavior is supported.
Результат Generator The newly created generator spy.
Пример #1
0
 /**
  * Create a new generator spy.
  *
  * @param Call      $call      The call from which the generator originated.
  * @param Generator $generator The generator.
  *
  * @return 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;
 }