public function genTwo(Chan $ch, $limit) { for ($i = 0; $i <= $limit; $i++) { $ch->add($i); } $ch->add(null); }
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); }
/** * @expectedException \Exception */ public function testChanWrongType2() { // given $entity = "foo"; $ch = new Chan(Foo::getClass(), $this->driver, $this->mapper); // when $ch->add($entity); }
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); } }