PHPackages                             kdaviesnz/callbackfileiterator - 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. kdaviesnz/callbackfileiterator

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

kdaviesnz/callbackfileiterator
==============================

Class that iterators over files and applies a user-defined callback.

2.0.1(8y ago)0741MITPHPPHP ~7.0

Since Apr 20Pushed 8y ago1 watchersCompare

[ Source](https://github.com/kdaviesnz/CallbackFileIterator)[ Packagist](https://packagist.org/packages/kdaviesnz/callbackfileiterator)[ Docs](https://github.com/kdaviesnz/callbackfileiterator)[ RSS](/packages/kdaviesnz-callbackfileiterator/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (4)Dependencies (3)Versions (5)Used By (1)

CallbackFileIterator
====================

[](#callbackfileiterator)

Class that iterators over files and applies a user-defined callback.

Note that using the parallel processing option may not necessarily result in faster times. It all depends on how slow the callback is.

Install
-------

[](#install)

Via Composer

```
$ composer require kdaviesnz/callbackfileiterator
```

Usage
-----

[](#usage)

```
        require_once("vendor/autoload.php");
        require_once("src/CallbackFileIterator.php");

		require_once("src/CallbackFileIterator.php");
		$callback = function() {
			return function(string $filename) {
				echo $filename . "\n";
				sleep (1);
			};
		};

        $callbackIterator = new CallbackFileIterator();
        $recursive = true;
        $parallel = true;

        // Parallel
        $parallelStartTime = \microtime(true);
        $callbackIterator->run(".", $callback(), $recursive, $parallel);
        $parallelEndTime = \microtime(true);

        // Non parallel
        $nonParallelStartTime = \microtime(true);
        $callbackIterator->run(".", $callback(), $recursive, $parallel);
        $nonParallelEndTime = \microtime(true);

        $parallelTime = $parallelEndTime - $parallelStartTime;
        $nonParallelTime = $nonParallelEndTime - $nonParallelStartTime;

        echo "Parallel took $parallelTime ms\n";
        echo "Non parallel took $nonParallelTime ms\n";
```

Change log
----------

[](#change-log)

Please see CHANGELOG.md for more information on what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

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

[](#contributing)

Please see CONTRIBUTING.md and CODE\_OF\_CONDUCT.md for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

-

License
-------

[](#license)

The MIT License (MIT). Please see LICENSE.md for more information.

CallbackFileIterator
====================

[](#callbackfileiterator-1)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity61

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

Total

4

Last Release

2939d ago

Major Versions

v1.0.0-beta → v2.0.02018-04-28

### Community

Maintainers

![](https://www.gravatar.com/avatar/3b63930ad10271ff6fe9e1ce3446ebc46b67edda7afc70fd09a3970f55215617?d=identicon)[kdaviesnz](/maintainers/kdaviesnz)

---

Top Contributors

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

---

Tags

kdaviesnzcallback file iterator

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/kdaviesnz-callbackfileiterator/health.svg)

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

###  Alternatives

[robholmes/term-extractor

Term Extractor - a PHP port of Topia's Term Extractor

185.5k](/packages/robholmes-term-extractor)

PHPackages © 2026

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