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

Abandoned → [h4kuna/data-type](/?search=h4kuna%2Fdata-type)Library[Utility &amp; Helpers](/categories/utility)

h4kuna/iterators
================

tools ala iterators

v2.0.2(3y ago)417.8k↓89.6%11MITPHPPHP &gt;=8.0CI failing

Since Oct 12Pushed 2y ago2 watchersCompare

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

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

Moved to [h4kuna/data-type](https://github.com/h4kuna/data-type/tree/main/src/Iterators)
========================================================================================

[](#moved-to-h4kunadata-type)

h4kuna\\iterators
=================

[](#h4kunaiterators)

[![Downloads this Month](https://camo.githubusercontent.com/2d509988063b7562754f36fb31d26674b16104e48bab09a1b95d0f15f900b0d6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f68346b756e612f6974657261746f72732e737667)](https://packagist.org/packages/h4kuna/iterators)[![Latest Stable Version](https://camo.githubusercontent.com/be3d7609736c1c5553454d0ca70a92d4c5b7b6a0b22acd39e19274860dc81fd3/68747470733a2f2f706f7365722e707567782e6f72672f68346b756e612f6974657261746f72732f762f737461626c653f666f726d61743d666c6174)](https://packagist.org/packages/h4kuna/iterators)[![Total Downloads](https://camo.githubusercontent.com/625487a250b573511430c89f5d0f5b3802bd12f21171f9c493049e54b68004e3/68747470733a2f2f706f7365722e707567782e6f72672f68346b756e612f6974657261746f72732f646f776e6c6f6164733f666f726d61743d666c6174)](https://packagist.org/packages/h4kuna/iterators)[![License](https://camo.githubusercontent.com/a4027917a564514a32facc3a114b8663f5a354bbfaf9a0e8f1c92fc5abcd87c7/68747470733a2f2f706f7365722e707567782e6f72672f68346b756e612f6974657261746f72732f6c6963656e73653f666f726d61743d666c6174)](https://packagist.org/packages/h4kuna/iterators)

Best way to install h4kuna\\iterators is using composer.

```
$ composer require h4kuna/iterators

```

TextIterator
------------

[](#textiterator)

Read the text line by line.

```
$incomingString = "  foo

bar
joe";

$textIterator = new TextIterator($incomingString);
$textIterator->setFlags($textIterator::SKIP_EMPTY_LINE | $textIterator::TRIM_LINE);
foreach($textIterator as $line) {
    echo $line;
}
/*
 * output will be trimed
foo
bar
joe
*/
```

FlattenArrayIterator
--------------------

[](#flattenarrayiterator)

Make one level array from multidimensional with to use delimiter for join keys.

```
use h4kuna\Iterators\FlattenArrayRecursiveIterator;

$input = [
    'address' => [
        'street' => 'foo',
        'zip' => 29404,
        'c' => [
            'p' => '5',
            'e' => 10.6,
        ],
    ],
    'main' => ['a', 'b', 'c'],
    'email' => 'exampl@foo.com',
];

$iterator = new FlattenArrayRecursiveIterator($input, '%');
$output = [];
foreach ($iterator as $key => $item) {
    $output[$key] = $item;
}

// output is
// [
//    'address%street' => 'foo',
//    'address%zip' => 29404,
//    'address%c%p' => '5',
//    'address%c%e' => 10.6,
//    'main%0' => 'a',
//    'main%1' => 'b',
//    'main%2' => 'c',
//    'email' => 'exampl@foo.com',
// ]
```

PeriodDayFactory
----------------

[](#perioddayfactory)

Iterate between dates by days. A time is reset to midnight.

```
use h4kuna\Iterators\PeriodDayFactory;
$endDate = new \DateTime('1996-04-09 08:00:00');
$period = PeriodDayFactory::createExFromInTo(new \DateTime('1989-02-01 07:00:00'), $endDate);

foreach ($period as $date) {
    // first date is 1989-02-02
    // last date is 1996-04-09
}
```

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity76

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

Recently: every ~566 days

Total

14

Last Release

1204d ago

Major Versions

v1.2.3 → v2.0.02022-12-19

PHP version history (4 changes)v1.0.0PHP &gt;=5.3.2

v1.1.0PHP &gt;=5.3.0

v1.2.3PHP &gt;=7.4.0

v2.0.0PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/54b4efb9b89167fa3598b1a41477b20387390f4a0fb65b447bd6bb7c30a49020?d=identicon)[h4kuna](/maintainers/h4kuna)

---

Top Contributors

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

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

PHPackages © 2026

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