Skip to content

[READ-ONLY] A magic memoization function for Hyperf.

License

Notifications You must be signed in to change notification settings

friendsofhyperf/once

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Once

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()
    {
    }
}

Donate

If you like them, Buy me a cup of coffee. Alipay | WeChat

Contact

License

MIT