src/Core/Cache/RuntimeCacheTrait.php
protected function once($id, $closure, $refresh = false)
    {
        $key = $this->getCacheId($id);
        $cache = $this->getCacheInstance();

        if ($refresh) {
            $cache->remove($key);
        }

        return $cache->call($key, $closure);
    }
protected function once($id, $closure, $refresh = false)
    {
        $key = $this->getCacheId($id);
        $cache = $this->getCacheInstance();

        if ($refresh) {
            $cache->remove($key);
        }

        return $cache->call($key, $closure);
    }
protected function once ( $ id , $ closure , $ refresh = false ) { $ key = $ this -> getCacheId ( $ id ) ; $ cache = $ this -> getCacheInstance ( ) ; if ( $ refresh ) { $ cache -> remove ( $ key ) ; } return $ cache -> call ( $ key , $ closure ) ; }
Only get once if ID is same.

@param string   $id
@param callable $closure
@param bool     $refresh

@return  mixed
@throws \Psr\Cache\InvalidArgumentException
Only get once if ID is same .