Eris\Quantifier\ForAll::hook PHP Метод

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

public hook ( Eris\Listener $listener ) : self
$listener Eris\Listener
Результат self
    public function hook(Listener $listener)
    {
        $this->listeners[] = $listener;
        return $this;
    }

Usage Example

Пример #1
0
 /**
  * forAll($generator1, $generator2, ...)
  * @return Quantifier\ForAll
  */
 protected function forAll()
 {
     call_user_func($this->seedFunction, $this->seed);
     $generators = func_get_args();
     $quantifier = new Quantifier\ForAll($generators, $this->iterations, new Shrinker\ShrinkerFactory(['timeLimit' => $this->shrinkingTimeLimit]), $this->randFunction);
     foreach ($this->listeners as $listener) {
         $quantifier->hook($listener);
     }
     foreach ($this->terminationConditions as $terminationCondition) {
         $quantifier->stopOn($terminationCondition);
     }
     $this->quantifiers[] = $quantifier;
     return $quantifier;
 }