PHPackages                             rnix/bubble-sorter - 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. rnix/bubble-sorter

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

rnix/bubble-sorter
==================

An over-engineered implementation of bubble sort

10PHP

Since Feb 12Pushed 7y ago1 watchersCompare

[ Source](https://github.com/rnixik/bubble-sorter)[ Packagist](https://packagist.org/packages/rnix/bubble-sorter)[ RSS](/packages/rnix-bubble-sorter/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Bubble sorter
=============

[](#bubble-sorter)

A library which can sort items using bubble sort. Written with OOP, SOLID and love.

[![Build Status](https://camo.githubusercontent.com/fa4c5befa9c96495d39eed65905ef5212e9dd4d1d92cd5d90decc744801593c2/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f726e6978696b2f627562626c652d736f727465722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/rnixik/bubble-sorter)

Sorting
-------

[](#sorting)

```
$floatsToSort = [5, 8, 3, 12, 3];

$comparer = new \BubbleSorter\Comparer\FloatComparer();
$floatItemsCreator = new \BubbleSorter\Item\Creator\FloatCreator();
$floatItemsFromListCreator = new \BubbleSorter\Item\Creator\FloatsFromListCreator($floatItemsCreator);
$items = $floatItemsFromListCreator->createFromList(...$floatsToSort);

$collection = new \BubbleSorter\Collection\Collection(...$items);

$indexesGeneratorFactory = new \BubbleSorter\Generator\Factory\IndexesGeneratorFactory();
$indexesGeneratorBuilder = new \BubbleSorter\Generator\Builder\Builder($indexesGeneratorFactory);
$comparer = new \BubbleSorter\Comparer\FloatComparer();
$swapper = new \BubbleSorter\Swapper\Swapper();
$sorter = new \BubbleSorter\Sorter\Sorter($indexesGeneratorBuilder, $comparer, $swapper);
$sortedCollection = $sorter->sort($collection);

$itemsGeneratorFactory = new \BubbleSorter\Generator\Factory\ItemsGeneratorFactory();
$itemsGeneratorBuilder = new \BubbleSorter\Generator\Builder\Builder($itemsGeneratorFactory);
$extractor = new \BubbleSorter\Item\Extractor\FloatsToArrayExtractor($itemsGeneratorBuilder);
$sortedFloats = $extractor->extract($sortedCollection);

print_r($sortedFloats);
```

outputs

```
Array
(
    [0] => 3
    [1] => 3
    [2] => 5
    [3] => 8
    [4] => 12
)

```

See examples in `example` directory.

Tests
-----

[](#tests)

Work is in progress.

License
-------

[](#license)

The MIT License

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1389766?v=4)[R Nix](/maintainers/rnix)[@rnix](https://github.com/rnix)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/rnix-bubble-sorter/health.svg)

```
[![Health](https://phpackages.com/badges/rnix-bubble-sorter/health.svg)](https://phpackages.com/packages/rnix-bubble-sorter)
```

###  Alternatives

[hoanganh25991/php-read-ipa

Read basic info about an application from .ipa file.

111.5k](/packages/hoanganh25991-php-read-ipa)

PHPackages © 2026

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