Beispiel #1
0
 public function genTwo(Chan $ch, $limit)
 {
     for ($i = 0; $i <= $limit; $i++) {
         $ch->add($i);
     }
     $ch->add(null);
 }
Beispiel #2
0
 public function collectIfPrime(Chan $ch, Chan $ex, $n)
 {
     for ($i = 2; $i < $n; $i++) {
         if ($n % $i == 0) {
             $ex->add(true);
             return;
         }
     }
     $ch->add($n);
     $ex->add(true);
 }
Beispiel #3
0
 /**
  * @expectedException \Exception
  */
 public function testChanWrongType2()
 {
     // given
     $entity = "foo";
     $ch = new Chan(Foo::getClass(), $this->driver, $this->mapper);
     // when
     $ch->add($entity);
 }
Beispiel #4
0
 public function generateWords(Chan $txts, Chan $words, $numTxts)
 {
     error_log("GENERATE WORDS");
     for ($i = 0; $i < $numTxts; $i++) {
         $txt = $txts->get();
         $arr = $this->misspellingsOnly($this->toWords($this->removePunctuation($txt)));
         $words->add($arr);
     }
 }