PHPackages                             honeycomb/method-sort - 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. honeycomb/method-sort

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

honeycomb/method-sort
=====================

Misc framework/library agnostic utility classes and objects

3.0.3(4y ago)011[3 issues](https://github.com/btam06/Honeycomb/issues)[3 PRs](https://github.com/btam06/Honeycomb/pulls)MITPHPPHP &gt;=5.6.0

Since Mar 8Pushed 3y ago1 watchersCompare

[ Source](https://github.com/btam06/Honeycomb)[ Packagist](https://packagist.org/packages/honeycomb/method-sort)[ RSS](/packages/honeycomb-method-sort/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependencies (1)Versions (11)Used By (0)

Honeycomb
=========

[](#honeycomb)

Honeycomb is a collection of useful utility objects that are framework/library agnostic. Each class aims to do one thing and do it well.

MethodSort
----------

[](#methodsort)

The `MethodSort` class is a stateful object which implements `__invoke`, such that an instance of the object can be passed as a preconfigured comparison function for standard sorting. Method sort enables ordering objects via the results of called methods.

For example. Let's say you have a Person:

```
class Person {
	public function __construct($firstname, $lastname) {
		$this->firstname = $firstname;
		$this->lastname  = $lastname;
	}

	public function getFirstName()
	{
		return $this->firstname;
	}

	public function getLastName()
	{
		return $this->lastname;
	}
}
```

Now let's say you have an array of people:

```
$objects     = [
	'ms' => new Person('Matthew', 'Sahagian'),
	'mj' => new Person('Matthew', 'Jones'),
	'bt' => new Person('Brian', 'Tam')
];
```

You can sort them, by first name, then by last name using `MethodSort`:

```
$method_sort = new Honeycomb\MethodSort();

$method_sort->setOrder([
	'getFirstName' => 'asc',
	'getLastName'  => 'asc'
]);

uasort($objects, $method_sort);
```

Objects now contains:

```
array (
  'bt' =>
  Person::__set_state(array(
     'firstname' => 'Brian',
     'lastname' => 'Tam',
  )),
  'mj' =>
  Person::__set_state(array(
     'firstname' => 'Matthew',
     'lastname' => 'Jones',
  )),
  'ms' =>
  Person::__set_state(array(
     'firstname' => 'Matthew',
     'lastname' => 'Sahagian',
  )),
)
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 66.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

Every ~248 days

Recently: every ~0 days

Total

7

Last Release

1502d ago

Major Versions

1.0.0 → 2.0.02019-05-23

2.1.0 → 3.0.02022-04-05

### Community

Maintainers

![](https://www.gravatar.com/avatar/9eb44dbf90b4c54b8b6421c890a6cf6365c0f4880f8a9a443847dc1584049894?d=identicon)[btam06](/maintainers/btam06)

---

Top Contributors

[![btam06](https://avatars.githubusercontent.com/u/901667?v=4)](https://github.com/btam06 "btam06 (2 commits)")[![mattsah](https://avatars.githubusercontent.com/u/586346?v=4)](https://github.com/mattsah "mattsah (1 commits)")

###  Code Quality

TestsCodeception

### Embed Badge

![Health badge](/badges/honeycomb-method-sort/health.svg)

```
[![Health](https://phpackages.com/badges/honeycomb-method-sort/health.svg)](https://phpackages.com/packages/honeycomb-method-sort)
```

###  Alternatives

[butschster/meta-tags

The most powerful and extendable tools for managing SEO Meta Tags in your Laravel project

628730.7k2](/packages/butschster-meta-tags)

PHPackages © 2026

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