PHP Class Ouzo\Utilities\Suppliers

Afficher le fichier Open project: letsdrink/ouzo Class Usage Examples

Méthodes publiques

Méthode Description
memoize ( callable $function ) : Ouzo\Utilities\Supplier\Supplier Returns a supplier which caches the callback result and returns that value on subsequent calls to get().
memoizeWithExpiration ( callable $function, integer $expireTime = 3600 ) : Ouzo\Utilities\Supplier\Supplier Returns a supplier which caches the callback result and removes the cached value after specified time.

Method Details

memoize() public static méthode

Returns a supplier which caches the callback result and returns that value on subsequent calls to get().
public static memoize ( callable $function ) : Ouzo\Utilities\Supplier\Supplier
$function callable
Résultat Ouzo\Utilities\Supplier\Supplier

memoizeWithExpiration() public static méthode

Subsequent calls to get() return the cached value if expiration time has not passed. Time is passed in seconds.
public static memoizeWithExpiration ( callable $function, integer $expireTime = 3600 ) : Ouzo\Utilities\Supplier\Supplier
$function callable
$expireTime integer
Résultat Ouzo\Utilities\Supplier\Supplier