PHPackages                             piercemcgeough/phpquartiles - 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. piercemcgeough/phpquartiles

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

piercemcgeough/phpquartiles
===========================

PHP package for working out quartile values and placements based on a numeric array

v1.0.0(9y ago)3768MITPHPPHP ~5.6|~7.0

Since Jan 27Pushed 2y ago3 watchersCompare

[ Source](https://github.com/piercemcgeough/phpquartiles)[ Packagist](https://packagist.org/packages/piercemcgeough/phpquartiles)[ Docs](https://github.com/PierceMcGeough/phpquartiles)[ RSS](/packages/piercemcgeough-phpquartiles/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

phpquartiles
============

[](#phpquartiles)

[![Latest Version on Packagist](https://camo.githubusercontent.com/aa689ea034e3a84166599deb4f555665ac98a0a3ecbb0cee590916948b08ee45/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f5069657263654d6347656f7567682f7068707175617274696c65732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/PierceMcGeough/phpquartiles)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/4a22805f7d3e15201a475085266e322b159605f7283a3e77e05966b4f7ad9b9c/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f5069657263654d6347656f7567682f7068707175617274696c65732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/PierceMcGeough/phpquartiles)[![Coverage Status](https://camo.githubusercontent.com/f2f49ae4be410c7829673893c37e28a5f34f3a65e246cb90ad54e81ddb0585df/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f5069657263654d6347656f7567682f7068707175617274696c65732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/PierceMcGeough/phpquartiles/code-structure)[![Quality Score](https://camo.githubusercontent.com/bc22e51c91e6d46058a3bb3fc59010b069b3a915133c5b11e4046214ff78fdb4/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f5069657263654d6347656f7567682f7068707175617274696c65732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/PierceMcGeough/phpquartiles)[![Total Downloads](https://camo.githubusercontent.com/53a5c93f90c3186bc25b69aa3905df314802c481ac9be9917a4b533fc5f1d669/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f5069657263654d6347656f7567682f7068707175617274696c65732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/PierceMcGeough/phpquartiles)

PHP package for working out quartile values and placements based on a numeric array.

phpquartiles will return the 1st, 2nd and 3rd quartiles. You can also then find the quartile placement of a given score.

Install
-------

[](#install)

Via Composer

`$ composer require PierceMcGeough/phpquartiles`

Usage
-----

[](#usage)

```
$scoresArray = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
$quartiles = new PierceMcGeough\phpquartiles\Quartile();

```

### Quartile Commands

[](#quartile-commands)

```
$quartiles->getAllQuartiles();
/**
 *  returns
 *
 *  [
 *      [q1] => 4
 *      [q2] => 8
 *      [q3] => 12
 *  ]
 */

$quartiles->getFirstQuartile();
/**
 *  returns
 *
 *  4
 */

$quartiles->getMedianQuartile();
/**
 *  returns
 *
 *  8
 */

$quartiles->getSecondQuartile();
/**
 *  alias of getMedianQuartile()
 *  returns
 *
 *  8
 */

$quartiles->getThirdQuartile();
/**
 *  returns
 *
 *  12
 */

```

### Placement Commands

[](#placement-commands)

```
$quartiles->getPlacement(15);
/**
 *  returns
 *
 *  HIGHEST_QUARTILE
 */

$quartiles->getPlacementInverse(15);
/**
 *  returns
 *
 *  LOWEST_QUARTILE
 */

```

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

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Testing
-------

[](#testing)

```
$ composer test
```

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

Security
--------

[](#security)

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

Credits
-------

[](#credits)

- [Pierce McGeough](https://github.com/PierceMcGeough)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.7% 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

3395d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9239900b591d45b4e6df5c5136c89d3b5c766ec4bc8e885d1194828a0a852447?d=identicon)[piercemcgeough](/maintainers/piercemcgeough)

---

Top Contributors

[![piercemcgeough](https://avatars.githubusercontent.com/u/3092809?v=4)](https://github.com/piercemcgeough "piercemcgeough (51 commits)")[![renedekat](https://avatars.githubusercontent.com/u/8975204?v=4)](https://github.com/renedekat "renedekat (3 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")

---

Tags

PierceMcGeoughphpquartiles

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/piercemcgeough-phpquartiles/health.svg)

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

PHPackages © 2026

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