PHPackages                             najidev/permutation - 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. najidev/permutation

ActiveLibrary

najidev/permutation
===================

1.0.0(11y ago)243.3k—5.6%1MITPHPPHP &gt;=5.3.0

Since Jun 20Pushed 11y ago1 watchersCompare

[ Source](https://github.com/rejinka/permutation)[ Packagist](https://packagist.org/packages/najidev/permutation)[ RSS](/packages/najidev-permutation/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (1)

Permutation
===========

[](#permutation)

Abstract
--------

[](#abstract)

Mathematicians define a permutation as follows:

> "\[...\] the notion of permutation relates to the act of permuting, or rearranging, members of a set into a particular sequence or order (unlike combinations, which are selections that disregard order). For example, there are six permutations of the set {1,2,3}, namely (1,2,3), (1,3,2), (2,1,3), (2,3,1), (3,1,2), and (3,2,1)." \[1\]

This package provides tools for managing permutations - for the time it just provides one tool for creating permutations. It was created to easily build phpunit-testcases with permutations.

PermutationIterator
-------------------

[](#permutationiterator)

The usage of the PermutationIterator is quite simple:

```
$set = [1, 2, 3];

$iterator = new NajiDev\Permutation\PermutationIterator($set);

foreach ($iterator as $permutationOfSet) {
    var_dump($permutationOfSet);
}

```

In each iteration one of the following arrays (just once) will be dumped:

- array(1, 2, 3)
- array(1, 3, 2)
- array(2, 1, 3)
- array(2, 3, 1)
- array(3, 1, 2)
- array(3, 2, 1)

\[1\]

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

4350d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/573be161327ff6b6ae43158484a0d9049f822c7662cfb492e9766e58b70405b3?d=identicon)[Naji](/maintainers/Naji)

---

Top Contributors

[![rejinka](https://avatars.githubusercontent.com/u/831348?v=4)](https://github.com/rejinka "rejinka (4 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/najidev-permutation/health.svg)

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

PHPackages © 2026

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