PHPackages                             org\_heigl/trait-iterator - 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. org\_heigl/trait-iterator

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

org\_heigl/trait-iterator
=========================

A Trait for the iterator-interface

1.1.0(9y ago)16.1k12MITPHP

Since Mar 27Pushed 8y ago1 watchersCompare

[ Source](https://github.com/heiglandreas/IteratorTrait)[ Packagist](https://packagist.org/packages/org_heigl/trait-iterator)[ RSS](/packages/org-heigl-trait-iterator/feed)WikiDiscussions master Synced 3w ago

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

IteratorTrait
=============

[](#iteratortrait)

Often used implementation of the IteratorInterface

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

[](#installation)

```
composer require org_heigl/trait-iterator
```

Usage
-----

[](#usage)

Add it to a class like this:

```
use Org_Heigl\IteratorTrait\IteratorTrait;

class MyList implements \Iterator
{
    use IteratorTrait;

    /** Can be an array or an Object implementing traversable */
    protected $yourArrayToIterateOver = [];

    public function & getIterableElement()
    {
        return $yourArrayToIterateOver
    }
}
```

The rest of the Iterator implementation is handled within the IteratorTrait.

Issues
------

[](#issues)

Feel free to drop an issue on github when you need help.

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity64

Established project with proven stability

 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

Every ~185 days

Total

2

Last Release

3555d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5ae5183aaad2bc7453230704bd6991dc6ccbcd6e775c6a29efdc94350a69f247?d=identicon)[heiglandreas](/maintainers/heiglandreas)

---

Top Contributors

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

---

Tags

interfacetraititerator

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/org-heigl-trait-iterator/health.svg)

```
[![Health](https://phpackages.com/badges/org-heigl-trait-iterator/health.svg)](https://phpackages.com/packages/org-heigl-trait-iterator)
```

###  Alternatives

[nette/robot-loader

🍀 Nette RobotLoader: high performance and comfortable autoloader that will search and autoload classes within your application.

89354.3M346](/packages/nette-robot-loader)[nikic/iter

Iteration primitives using generators

1.1k6.2M51](/packages/nikic-iter)[loophp/collection

A (memory) friendly, easy, lazy and modular collection class.

743730.3k15](/packages/loophp-collection)[athari/yalinqo

YaLinqo, a LINQ-to-objects library for PHP

4531.2M5](/packages/athari-yalinqo)[kkszymanowski/traitor

Add a trait use statement to existing PHP class

1305.5M16](/packages/kkszymanowski-traitor)[chdemko/sorted-collections

Sorted Collections for PHP &gt;= 8.4

222.6M3](/packages/chdemko-sorted-collections)

PHPackages © 2026

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