any() public static method

If all yieldables failed, AllFailedException is thrown. If no yieldables found, AllFailedException is thrown.
public static any ( mixed $value ) : Generator
$value mixed
return Generator Resolved value.
Ejemplo n.º 1
0
 public function testAnyEmpty()
 {
     try {
         Co::wait(Co::any(['A', 'B']));
         $this->assertTrue(false);
     } catch (AllFailedException $e) {
         $this->assertEquals('Co::any() failed.', $e->getMessage());
         $this->assertEquals(['A', 'B'], $e->getReasons());
     }
 }