PHPackages                             dutekvejin/iterators - 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. dutekvejin/iterators

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

dutekvejin/iterators
====================

0.4.0(2y ago)28.6kMITPHPPHP ^7.1|^8.0

Since Jun 28Pushed 2y ago1 watchersCompare

[ Source](https://github.com/dutekvejin/iterators)[ Packagist](https://packagist.org/packages/dutekvejin/iterators)[ RSS](/packages/dutekvejin-iterators/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (6)Dependencies (2)Versions (7)Used By (0)

iterators
=========

[](#iterators)

[![Build Status](https://camo.githubusercontent.com/0c29ba59179bcdb4d82a85ced4fa961062918d1caf953d631c219ad4955816d4/68747470733a2f2f7472617669732d63692e6f72672f647574656b76656a696e2f6974657261746f72732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/dutekvejin/iterators)[![Code Quality](https://camo.githubusercontent.com/5cf694c4d7b58cbaead64bb880b498884ae269e5e619fd3d876c7cfe6059d967/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f647574656b76656a696e2f6974657261746f72732e737667)](https://scrutinizer-ci.com/g/dutekvejin/iterators)[![Code Coverage](https://camo.githubusercontent.com/e4245386c393c682cfd3f0c225a661f8fa7c4090f2382bc004f995052eba4c20/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f647574656b76656a696e2f6974657261746f72732e737667)](https://scrutinizer-ci.com/g/dutekvejin/iterators/code-structure)[![Latest Version](https://camo.githubusercontent.com/9154b6e47910fa52f98ec0debad8549937158563af457ccba5a6751701d62c0b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f647574656b76656a696e2f6974657261746f72732e737667)](https://packagist.org/packages/dutekvejin/iterators)[![PDS Skeleton](https://camo.githubusercontent.com/a8ce1f2a7b71f101b18fc0393ba5bf89b7a5b1f9d08a31b658ca0eab0064c0f6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7064732d736b656c65746f6e2d626c75652e737667)](https://github.com/php-pds/skeleton)

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

[](#installation)

The preferred method of installation is via [Composer](http://getcomposer.org/). Run the following command to install the latest version of a package and add it to your project's `composer.json`:

```
composer require dutekvejin/iterators
```

Usage
-----

[](#usage)

#### `Dutek\Iterator\ChunkIterator`

[](#dutekiteratorchunkiterator)

Chunks an `\Iterator` into arrays with `size` elements.

```
use Dutek\Iterator\ChunkIterator;

$iterator = new \ArrayIterator([1, 2, 3, 4, 5]);
$size = 2;
$chunkIterator = new ChunkIterator($iterator, $size);

assert(iterator_to_array($chunkIterator) === [[1, 2], [3, 4], [5]]);
```

#### `Dutek\Iterator\MapIterator`

[](#dutekiteratormapiterator)

Applies the callback to the elements of the given `\Iterator`.

```
use Dutek\Iterator\MapIterator;

$iterator = new \ArrayIterator([1, 2, 3, 4, 5]);
$callback = function (int $item) {
    return $item ** 2;
};
$mapIterator = new MapIterator($iterator, $callback);

assert(iterator_to_array($mapIterator) === [1, 4, 9, 16, 25]);
```

Credits
-------

[](#credits)

- [Dusan Vejin](https://github.com/dutekvejin)
- [All Contributors](../../contributors)

License
-------

[](#license)

Released under MIT License - see the [License File](LICENSE) for details.

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

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 ~439 days

Recently: every ~549 days

Total

6

Last Release

1089d ago

PHP version history (3 changes)0.1.0PHP ^7.0

0.3.0PHP ^7.1

0.4.0PHP ^7.1|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/41c86db15b024a226947adeb93c6f51e7373c81f863a193c5a073dd9a6ae1a9e?d=identicon)[dutekvejin](/maintainers/dutekvejin)

---

Top Contributors

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

---

Tags

iteratoriteratorsphp7iteratorsdutekvejin

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/dutekvejin-iterators/health.svg)

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

###  Alternatives

[doctrine/collections

PHP Doctrine Collections library that adds additional functionality on top of PHP arrays.

6.0k423.8M1.4k](/packages/doctrine-collections)[drupol/phpermutations

Generators and iterators, permutations and combinations.

80713.5k5](/packages/drupol-phpermutations)[loophp/iterators

The missing PHP iterators.

37523.1k3](/packages/loophp-iterators)[tatter/settings

Lightweight settings management for CodeIgniter 4

2310.0k3](/packages/tatter-settings)

PHPackages © 2026

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