PHPackages                             rixxi/utils - 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. rixxi/utils

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

rixxi/utils
===========

1.0.0(12y ago)020BSD-3-ClausePHPPHP &gt;=5.3

Since May 6Pushed 12y ago1 watchersCompare

[ Source](https://github.com/rixxi/utils)[ Packagist](https://packagist.org/packages/rixxi/utils)[ RSS](/packages/rixxi-utils/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersions (2)Used By (0)

Batch allows you to separate code that is fetching data and processing them in batches. It has many uses.

Example
=======

[](#example)

Write ten lines of 80 characters per line.

```
use Rixxi\Utils\Batch;

$batch = new Batch(function ($values) {
	echo implode($values), PHP_EOL;
}, $limit = 80);

$lines = 10;
for ($x = $limit * $lines; $x-- > 0;) {
	$batch[] = chr(ord('A') + rand(0, 26 /* ord('Z') - ord('A') */));
}
```

Flushing &amp; Callback
=======================

[](#flushing--callback)

Batch is automatically flushed and reset when limit is reached and when is destroyed.

If **no items were added** to batch since start or last flush **callback is not called**.

You can flush batch manually at any point calling `flush()`.

```
$batch->flush();
```

Or flush and throw away calling unset on batch.

```
unset($batch);
```

Usually you don't have to unset since garbage collector will do it for you at the end of function.

Install
=======

[](#install)

```
composer require rixxi/utils
```

Troubleshooting
===============

[](#troubleshooting)

If you are getting random errors after processing data via Batch make sure you flush it before doing anything else. *You are probably assuming all data are flushed when there might be few left after last round.*

Ie.: in Doctrine when processing entities don't forget to flush manually before calling `$repository->clear();`.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

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

4395d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/276500?v=4)[Michal Gebauer](/maintainers/mishak87)[@mishak87](https://github.com/mishak87)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/rixxi-utils/health.svg)

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

PHPackages © 2026

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