Ouzo\Utilities\Supplier\ExpiringMemoizingSupplier::get PHP Method

get() public method

public get ( )
    public function get()
    {
        $function = $this->function;
        $now = Clock::now()->getTimestamp();
        if ($this->cachedResult === null || $now - $this->lastCallTime > $this->expireTime) {
            $this->cachedResult = $function();
            $this->lastCallTime = $now;
        }
        return $this->cachedResult;
    }
ExpiringMemoizingSupplier