PHPackages                             litgroup/equatable - 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. litgroup/equatable

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

litgroup/equatable
==================

Provides EquatableInterface for PHP 7+

v2.0.0(9y ago)038011MITPHPPHP ^7.0

Since Aug 15Pushed 9y ago1 watchersCompare

[ Source](https://github.com/LitGroup/equatable.php)[ Packagist](https://packagist.org/packages/litgroup/equatable)[ RSS](/packages/litgroup-equatable/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (3)Used By (1)

Equatable for PHP
=================

[](#equatable-for-php)

> Provides `Equatable` for PHP 7+ (inspired by Java).

[![Version](https://camo.githubusercontent.com/df84dc174abaaf7b54338b80669d2497b874f73d4588abb315513fe53150344b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c697467726f75702f657175617461626c652e737667)](https://packagist.org/packages/litgroup/equatable)[![Downloads](https://camo.githubusercontent.com/fafd156dcb3c025d031f3a96332f721c0abb4fa52e4e8c7bad2b225cab545285/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c697467726f75702f657175617461626c652e737667)](https://packagist.org/packages/litgroup/equatable)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](https://raw.githubusercontent.com/LitGroup/equatable.php/master/LICENSE)

Installation
------------

[](#installation)

```
composer require litgroup/equatable:^2.0

```

What is inside
--------------

[](#what-is-inside)

```
interface Equatable
{
    /**
     * Checks if this object is equal to another one.
     */
    public function equals(Equatable $another): bool;
}
```

Example of usage
----------------

[](#example-of-usage)

```
namespace Acme;

use LitGroup\Equatable\Equatable;

class User
{
    private $username;
    private $email;

    public function __construct(string $username, string $email)
    {
        $this->username = $username;
        $this->email = $email;
    }

    public function getUsername(): string
    {
        return $this->username;
    }

    public function getEmail(): string
    {
        return $this->email;
    }

    /**
     * Example of implementation of Equatable::equals()
     */
    public function equals(Equatable $another): bool
    {
        return
            $another instanceOf User &&
            $another->getUsername() == $this->getUsername() &&
            $another->getEmail() == $this->getEmail()
        ;
    }
}
```

LICENSE
-------

[](#license)

See [LICENSE](https://raw.githubusercontent.com/LitGroup/equatable.php/master/LICENSE) file.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity59

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

Every ~36 days

Total

2

Last Release

3569d ago

Major Versions

v1.0.0 → v2.0.02016-09-21

### Community

Maintainers

![](https://www.gravatar.com/avatar/b22ffdbd95942ae3f342f2073f97f3a5716459ad5892f37f443948952b85c012?d=identicon)[Sharom](/maintainers/Sharom)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/litgroup-equatable/health.svg)

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

###  Alternatives

[spatie/laravel-url-ai-transformer

Transform URLs and their content using AI

266.8k](/packages/spatie-laravel-url-ai-transformer)

PHPackages © 2026

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