PHPackages                             rocketfellows/tuple - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. rocketfellows/tuple

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rocketfellows/tuple
===================

v1.0.0(3y ago)01.1k3MITPHP

Since May 30Pushed 3y agoCompare

[ Source](https://github.com/rocketfellows/tuple)[ Packagist](https://packagist.org/packages/rocketfellows/tuple)[ RSS](/packages/rocketfellows-tuple/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (3)

Simple tuple implementation
===========================

[](#simple-tuple-implementation)

[![Code Coverage Badge](./badge.svg)](./badge.svg)

This component is simple implementation of immutable ordered sequence of elements with strict types. Which means that once tuple created it can't be immuted. Tuple also provide elements of the same type.

Installation
------------

[](#installation)

```
composer require rocketfellows/tuple
```

Usage example
-------------

[](#usage-example)

Typed item class:

```
class TupleItem
{
    private $id;

    public function __construct(int $id)
    {
        $this->id = $id;
    }

    public function getId(): int
    {
        return $this->id;
    }
}
```

Items tuple implementation:

```
use rocketfellows\tuple\Tuple;

class Items extends Tuple
{
    public function __construct(TupleItem ...$items)
    {
        parent::__construct(...$items);
    }

    public function current(): ?TupleItem
    {
        return parent::current();
    }
}
```

Load tuple and loop through:

```
$firstTupleItem = new TupleItem(1);
$secondTupleItem = new TupleItem(2);
$thirdTupleItem = new TupleItem(3);

$items = new Items($firstTupleItem, $secondTupleItem, $thirdTupleItem);

foreach ($items as $item) {
    print_r($item->getId());
}
```

Result:

```
1
2
3
```

Contributing
------------

[](#contributing)

Welcome to pull requests. If there is a major changes, first please open an issue for discussion.

Please make sure to update tests as appropriate.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1449d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/81402dcd0a07ad550b7f80f5871e7c302770b29d4c73a52fc35ba697f702d56e?d=identicon)[arslanim](/maintainers/arslanim)

---

Top Contributors

[![arslanim](https://avatars.githubusercontent.com/u/22678154?v=4)](https://github.com/arslanim "arslanim (8 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (2 commits)")

---

Tags

phptuple

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/rocketfellows-tuple/health.svg)

```
[![Health](https://phpackages.com/badges/rocketfellows-tuple/health.svg)](https://phpackages.com/packages/rocketfellows-tuple)
```

###  Alternatives

[astrotomic/laravel-vcard

A fluent builder class for vCard files.

5330.0k](/packages/astrotomic-laravel-vcard)[digital-creative/icon-action-toolbar

Allows you to update a single column of a resource all at once.

2626.0k](/packages/digital-creative-icon-action-toolbar)[trive/module-revo

A Magento 2 module for managing product carousel

103.7k](/packages/trive-module-revo)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
