コード例 #1
0
 public function testConsume()
 {
     $consumer = UnaryConsumer::create(self::getCallable());
     $a = rand(1, 100);
     ob_start();
     $consumer->consume($a);
     $result = trim(ob_get_clean());
     $this->assertEquals("{$a}", $result);
 }
コード例 #2
0
ファイル: Callables.php プロジェクト: intrawarez/sabertooth
 /**
  *
  * @param callable $consumer
  * @return UnaryConsumerInterface
  */
 public static final function newUnaryConsumer(callable $consumer) : UnaryConsumerInterface
 {
     return UnaryConsumer::create($consumer);
 }