PHP Class mpyw\Co\Internal\GeneratorContainer

Exibir arquivo Open project: mpyw/co Class Usage Examples

Public Methods

Method Description
__construct ( Generator $g, $yield_key = null ) Constructor.
__toString ( ) : string Return generator hash.
current ( ) : mixed Return current value.
getReturnOrThrown ( ) : mixed Return value that generator has returned or thrown.
getYieldKey ( ) : mixed Return parent yield key.
key ( ) : mixed Return current key.
send ( mixed $value ) Send value into generator.
throw_ ( Throwable | Exception $e ) Throw exception into generator.
thrown ( ) : boolean Return whether Throwable is thrown.
valid ( ) : boolean Return whether generator is actually working.

Private Methods

Method Description
validateInvalidity ( ) Validate that generator is still running.
validateValidity ( ) Validate that generator has finished running.

Method Details

__construct() public method

Constructor.
public __construct ( Generator $g, $yield_key = null )
$g Generator

__toString() public method

Return generator hash.
public __toString ( ) : string
return string

current() public method

Return current value.
public current ( ) : mixed
return mixed

getReturnOrThrown() public method

Return value that generator has returned or thrown.
public getReturnOrThrown ( ) : mixed
return mixed

getYieldKey() public method

Return parent yield key.
public getYieldKey ( ) : mixed
return mixed

key() public method

Return current key.
public key ( ) : mixed
return mixed

send() public method

Send value into generator.
public send ( mixed $value )
$value mixed

throw_() public method

Throw exception into generator.
public throw_ ( Throwable | Exception $e )
$e Throwable | Exception

thrown() public method

Return whether Throwable is thrown.
public thrown ( ) : boolean
return boolean

valid() public method

Return whether generator is actually working.
public valid ( ) : boolean
return boolean