sbooker/persistent-pointer

1.0.1 2021-05-13 05:47 UTC

This package is auto-updated.

Last update: 2022-01-13 07:26:51 UTC


README

Latest Version Software License PHP Version Total Downloads

Installation

Install via Composer:

composer require sbooker/persistent-pointer

Usage

<?php

use Sbooker\PersistentPointer\Pointer;
use Sbooker\PersistentPointer\Repository;
use Sbooker\PersistentPointer\PointerStorage;

$pointer = new Pointer('name');
$pointer->getValue(); // returns 0

// Increase pointer
$pointer->increaseTo(2); 
$pointer->getValue(); // returns 2

// Decrease pointer
$pointer->increaseTo(1); // throws \InvalidArgumentException

License

See LICENSE file.