Ardent\Option::fromMaybeNull PHP Method

fromMaybeNull() public static method

public static fromMaybeNull ( $value )
    public static function fromMaybeNull($value)
    {
        return $value !== null ? Option::some($value) : Option::none();
    }

Usage Example

コード例 #1
0
ファイル: OptionTest.php プロジェクト: morrisonlevi/ardent
 public function testFromMaybeNull_WithNonNull_HasCountOfOne()
 {
     $this->assertCount(1, Option::fromMaybeNull("NonNull"));
 }