scienide / tuple
A fixed-length immutable list data structure for PHP.
Fund package maintenance!
andrewdalpino
Requires
- php: >=7.4
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- phpstan/extension-installer: ^1.0
- phpstan/phpstan: ^0.12.88
- phpstan/phpstan-phpunit: 0.12.*
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2024-11-18 05:43:08 UTC
README
An immutable list with a fixed-length whose elements are indexed by their offset in the list.
Installation
Install into your project using Composer:
$ composer require scienide/tuple
Requirements
- PHP 7.4 or above
Example
use Tuple; $tuple = new Tuple(5.0, 3, 'foo'); [$first, $second, $third] = $tuple->list(); foreach ($tuple as $offset => $value) { // } echo count($tuple); echo $tuple[2];
3
foo
Testing
To run the unit tests:
$ composer test
Static Analysis
To run static code analysis:
$ composer analyze