Ardent\Option::some PHP Method

some() public static method

public static some ( $thing )
    public static function some($thing)
    {
        return new Option(true, $thing);
    }

Usage Example

Exemplo n.º 1
0
 public function testSomeFilter_WithMatched_ReturnsSome()
 {
     $expect = 13;
     $predicate = function ($input) {
         return true;
     };
     $ifSome = function ($input) use($expect) {
         return $input;
     };
     $ifNone = function () {
         $this->fail();
     };
     $actual = Option::some($expect)->filter($predicate)->match($ifSome, $ifNone);
     $this->assertEquals($expect, $actual);
 }
All Usage Examples Of Ardent\Option::some