private static function &getStorage(ServerRequestInterface $request, $key = null)
    {
        if (!self::hasAttribute($request, Middleware::STORAGE_KEY)) {
            throw new RuntimeException('No session storage initialized');
        }

        $storage = self::getAttribute($request, Middleware::STORAGE_KEY);

        if (!isset($storage->$key)) {
            $storage->$key = [];
        }

        return $storage->$key;
    }
private static function &getStorage(ServerRequestInterface $request, $key = null)
    {
        if (!self::hasAttribute($request, Middleware::STORAGE_KEY)) {
            throw new RuntimeException('No session storage initialized');
        }

        $storage = self::getAttribute($request, Middleware::STORAGE_KEY);

        if (!isset($storage->$key)) {
            $storage->$key = [];
        }

        return $storage->$key;
    }
private static function & getStorage ( ServerRequestInterface $ request , $ key = null ) { if ( ! self :: hasAttribute ( $ request , Middleware :: STORAGE_KEY ) ) { throw new RuntimeException ( 'No session storage initialized' ) ; } $ storage = self :: getAttribute ( $ request , Middleware :: STORAGE_KEY ) ; if ( ! isset ( $ storage -> $ key ) ) { $ storage -> $ key = [ ] ; } return $ storage -> $ key ; }
Returns the value of a storage array.

@param ServerRequestInterface $request
@param string|null            $key

@return array
Returns the value of a storage array .