Skip to content

About

No description, website, or topics provided.

Resources

Stars

7 stars

Watchers

2 watching

Forks

Repository files navigation

PHPyh LRU Memoizer

Installation

composer require phpyh/lru-memoizer

Usage

use PHPyh\LRUMemoizer\LRUMemoizer;

final class Metadata {}

final class MetadataFactory
{
    public function __construct(
        private readonly LRUMemoizer $memoizer = new LRUMemoizer(capacity: 25),
    ) {
    }

    /**
     * @param ?class-string $class
     */
    public function metadataFor(string $class): Metadata
    {
        return $this->memoizer->get($class, static fn (): Metadata => new Metadata());
    }
}

About

No description, website, or topics provided.

Resources

Stars

7 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages