lctrs / circular-buffer
Provides a circular buffer implementation.
Installs: 742
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 9
pkg:composer/lctrs/circular-buffer
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
- dev-master
- 0.1.0
- dev-renovate/all-minor-patch
- dev-renovate/phpstan-phpstan-2.x
- dev-renovate/doctrine-coding-standard-14.x
- dev-renovate/phpstan-phpstan-strict-rules-2.x
- dev-renovate/lock-file-maintenance
- dev-renovate/phpstan-phpstan-phpunit-2.x
- dev-renovate/phpstan-phpstan-deprecation-rules-2.x
- dev-renovate/codecov-codecov-action-5.x
This package is auto-updated.
Last update: 2025-10-08 17:48:38 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
.