PHP Class Ardent\Option

Inheritance: implements Countabl\Countable, implements IteratorAggregat\IteratorAggregate
Show file Open project: morrisonlevi/ardent Class Usage Examples

Public Methods

Method Description
count ( )
filter ( callable $f )
fromMaybeFalse ( $value )
fromMaybeNull ( $value )
fromPredicate ( callable $f, $value )
getIterator ( )
map ( callable $f )
match ( callable $ifSome, callable $ifNone )
none ( )
some ( $thing )

Private Methods

Method Description
__construct ( $has_value, $value )

Method Details

count() public method

public count ( )

filter() public method

public filter ( callable $f )
$f callable

fromMaybeFalse() public static method

public static fromMaybeFalse ( $value )

fromMaybeNull() public static method

public static fromMaybeNull ( $value )

fromPredicate() public static method

public static fromPredicate ( callable $f, $value )
$f callable

getIterator() public method

public getIterator ( )

map() public method

public map ( callable $f )
$f callable

match() public method

public match ( callable $ifSome, callable $ifNone )
$ifSome callable
$ifNone callable

none() public static method

public static none ( )

some() public static method

public static some ( $thing )