Ardent\Option::fromMaybeNull PHP 메소드

fromMaybeNull() 공개 정적인 메소드

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

Usage Example

예제 #1
0
 public function testFromMaybeNull_WithNonNull_HasCountOfOne()
 {
     $this->assertCount(1, Option::fromMaybeNull("NonNull"));
 }