lctrs / circular-buffer
Provides a circular buffer implementation.
0.1.0
2021-10-16 13:56 UTC
Requires
- php: ^7.3.0 || >=8.0.0 <8.2.0
Requires (Dev)
- doctrine/coding-standard: ^9.0.0
- ergebnis/composer-normalize: ^2.15.0
- ergebnis/license: ^1.1.0
- ergebnis/test-util: ^1.5.0
- phpstan/extension-installer: ^1.1.0
- phpstan/phpstan: ^0.12.99
- phpstan/phpstan-deprecation-rules: ^0.12.6
- phpstan/phpstan-phpunit: ^0.12.22
- phpstan/phpstan-strict-rules: ^0.12.11
- phpunit/phpunit: ^9.5.10
- psalm/plugin-phpunit: ^0.16.1
- vimeo/psalm: ^4.10.0
This package is auto-updated.
Last update: 2024-11-24 09:23:12 UTC
README
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
.