Ardent\Option::none PHP Method

none() public static method

public static none ( )
    public static function none()
    {
        static $none = null;
        if ($none === null) {
            $none = new Option(false, null);
        }
        return $none;
    }

Usage Example

Example #1
0
 public function testNoneFilter()
 {
     $expect = 13;
     $f = function ($input) {
         $this->fail();
     };
     $ifSome = function ($input) {
         $this->fail();
     };
     $ifNone = function () use($expect) {
         return $expect;
     };
     $actual = Option::none()->filter($f)->match($ifSome, $ifNone);
     $this->assertEquals($expect, $actual);
 }
All Usage Examples Of Ardent\Option::none