public function get(string $key, $default = null)
    {
        $value = static::$handler->get($this->normalized($key));
        // If we could not find the cache value, we will get
        // the default value for this cache value. This default could be a callback
        // so we will execute the value function which will resolve it if needed.
        if (is_null($value)) {
            $value = is_callable($default) ? $default() : $default;
        }

        if (static::hasMacro()) {
            $value = $this->runMacro('getAfter', [$value, $key, false]);
        }

        return $value;
    }
public function get(string $key, $default = null)
    {
        $value = static::$handler->get($this->normalized($key));
        // If we could not find the cache value, we will get
        // the default value for this cache value. This default could be a callback
        // so we will execute the value function which will resolve it if needed.
        if (is_null($value)) {
            $value = is_callable($default) ? $default() : $default;
        }

        if (static::hasMacro()) {
            $value = $this->runMacro('getAfter', [$value, $key, false]);
        }

        return $value;
    }
public function get ( string $ key , $ default = null ) { $ value = static :: $ handler -> get ( $ this -> normalized ( $ key ) ) ; // If we could not find the cache value, we will get // the default value for this cache value. This default could be a callback // so we will execute the value function which will resolve it if needed. if ( is_null ( $ value ) ) { $ value = is_callable ( $ default ) ? $ default ( ) : $ default ; } if ( static :: hasMacro ( ) ) { $ value = $ this -> runMacro ( 'getAfter' , [ $ value , $ key , false ] ) ; } return $ value ; }
Retrieve an item from the cache by key.

@param string $key     键
@param mixed  $default 默认值

@return mixed
Retrieve an item from the cache by key .