PHP Class mpyw\Co\Internal\GeneratorContainer

Afficher le fichier Open project: mpyw/co Class Usage Examples

Méthodes publiques

Méthode 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

Méthode Description
validateInvalidity ( ) Validate that generator is still running.
validateValidity ( ) Validate that generator has finished running.

Method Details

__construct() public méthode

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

__toString() public méthode

Return generator hash.
public __toString ( ) : string
Résultat string

current() public méthode

Return current value.
public current ( ) : mixed
Résultat mixed

getReturnOrThrown() public méthode

Return value that generator has returned or thrown.
public getReturnOrThrown ( ) : mixed
Résultat mixed

getYieldKey() public méthode

Return parent yield key.
public getYieldKey ( ) : mixed
Résultat mixed

key() public méthode

Return current key.
public key ( ) : mixed
Résultat mixed

send() public méthode

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

throw_() public méthode

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

thrown() public méthode

Return whether Throwable is thrown.
public thrown ( ) : boolean
Résultat boolean

valid() public méthode

Return whether generator is actually working.
public valid ( ) : boolean
Résultat boolean