A magic memoization function for hyperf.

v2.0.2-beta.1 2022-09-21 00:24 UTC

This package is auto-updated.

Last update: 2022-11-21 00:52:11 UTC


README

Latest Test Latest Stable Version Total Downloads GitHub license

A magic memoization function for hyperf.

Installation

  • Installation
composer require friendsofhyperf/once

Documentation

Usage

use FriendsOfHyperf\Once\Annotation\Forget;
use FriendsOfHyperf\Once\Annotation\Once;

class Foo
{
    #[Once]
    public function getNumber(): int
    {
        return rand(1, 10000);
    }

    #[Forget]
    public function forgetNumber()
    {
    }
}