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

Esempio n. 1
0
 public function testFromMaybeNull_WithNonNull_HasCountOfOne()
 {
     $this->assertCount(1, Option::fromMaybeNull("NonNull"));
 }