Modular Framework  1.0
A light and thin PHP Framework
Loading...
Searching...
No Matches
Optional Class Reference

Public Member Functions

 isPresent ()
 
 isEmpty ()
 
 ifPresent (callable $callable)
 
 orElse ($other)
 
 orElseThrow (Exception $exception)
 
 get ()
 

Static Public Member Functions

static of ($nullable)
 
static empty ()
 

Detailed Description

@template T

Member Function Documentation

◆ empty()

static empty ( )
static
Returns
Optional<T>

◆ get()

get ( )
Returns
T
Exceptions
Exception

◆ ifPresent()

ifPresent ( callable  $callable)

◆ isEmpty()

isEmpty ( )

◆ isPresent()

isPresent ( )

◆ of()

static of (   $nullable)
static
Parameters
T$nullable
Returns
Optional<T>

◆ orElse()

orElse (   $other)
Parameters
T$other
Returns
T

◆ orElseThrow()

orElseThrow ( Exception  $exception)
Returns
T
Exceptions
Exception