g4/identity-map

identity-map php library

1.3.0 2023-02-20 14:21 UTC

This package is auto-updated.

Last update: 2024-11-20 17:55:57 UTC


README

identity-map - In-memory data store - php library

Build Status

Install

composer require g4/identity-map

Usage

use G4\IdentityMap\IdentityMap;

$identityMap = new IdentityMap();

$key = 'some_unique_key';
$data = 'some_data';

// add data 
$identityMap->set($key, $data);

// retrieve data
$data = $identityMap->get($key);

// check if data is stored
$identityMap->has($key);

// remove data
$identityMap->delete($key);

// clear all
$identityMap->clear();

Development

Install dependencies

composer install

Run tests

composer unit-test

License

(The MIT License) see LICENSE file for details...