lctrs/circular-buffer

This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

Provides a circular buffer implementation.

0.1.0 2021-10-16 13:56 UTC

This package is auto-updated.

Last update: 2021-11-26 01:18:40 UTC


README

Integrate Release Renew

Mutation Score Code Coverage Type Coverage

Latest Stable Version Total Downloads

Installation

💡 This is a great place for showing how to install the package, see below:

Run

$ composer require lctrs/circular-buffer

Usage

Creating an empty circular buffer of size eg. 2:

use Lctrs\CircularBuffer\CircularBuffer;

$buffer = CircularBuffer::ofCapacity(2);
$buffer->write('foo');
$buffer->read(); // foo

You can also create a prefilled buffer:

use Lctrs\CircularBuffer\CircularBuffer;

$buffer = CircularBuffer::prefilled(2, ['foo', 'bar']);

Changelog

Please have a look at CHANGELOG.md.

Contributing

Please have a look at CONTRIBUTING.md.

License

This package is licensed using the MIT License.

Please have a look at LICENSE.md.