예제 #1
0
 public function genTwo(Chan $ch, $limit)
 {
     for ($i = 0; $i <= $limit; $i++) {
         $ch->add($i);
     }
     $ch->add(null);
 }
예제 #2
0
 private function aggregateWords(Chan $words, $numWords)
 {
     $wordsArr = [];
     for ($i = 0; $i < $numWords; $i++) {
         $wordsArr = array_merge($wordsArr, $words->get());
     }
     return $wordsArr;
 }
예제 #3
0
파일: ChanTest.php 프로젝트: fliglio/borg
 /**
  * @expectedException \Exception
  */
 public function testChanWrongType2()
 {
     // given
     $entity = "foo";
     $ch = new Chan(Foo::getClass(), $this->driver, $this->mapper);
     // when
     $ch->add($entity);
 }
예제 #4
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);
 }