Skip to content

Latest commit

 

History

History
24 lines (17 loc) · 368 Bytes

README.md

File metadata and controls

24 lines (17 loc) · 368 Bytes

Memoization

Usage

namespace App;

use Kalibora\Memoization\MemoizationTrait;

class HeavyProcessor
{
    use MemoizationTrait;

    public function process(): void
    {
        return $this->getMemoization()->memoize(__FUNCTION__, function () {
            // Very heavy processing takes place here.

            return $value;
        });
    }
}