PHPackages                             happyr/identifier-interface - 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. happyr/identifier-interface

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

happyr/identifier-interface
===========================

Write down your routing mapping at one place

1.0.0(12y ago)0381MITPHPPHP &gt;=5

Since Jan 1Pushed 12y ago1 watchersCompare

[ Source](https://github.com/Happyr/IdentifierInterface)[ Packagist](https://packagist.org/packages/happyr/identifier-interface)[ Docs](http://developer.happyr.se/)[ RSS](/packages/happyr-identifier-interface/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (2)Used By (0)

HappyR Identifier Interface
===========================

[](#happyr-identifier-interface)

This "library" is not much. It is just one interface. The interface makes sure you have a public function called *getId()*.

Say that you are writing AcmeMessageBundle with a Message entity. Each Message should have a relation to a User. You could write something like this:

```
class Message
{
  private $user;

  /* ... */

  public function setUser(IdentifierInterface $user)
  {
    $this->user = $user;
  }

  /* ... */
}

class MessageSenderService
{
  /* ... */
  public function send(Message $message, IdentifierInterface $recipient)
  {
     if ($message->getUser()->getId() == $recipient->getId()) {
        throw new \Exception("You can not send a message to yourself.");
     }

     /* ... */
  }
}
```

You could of course ship your own IdentifierInterface with your AcmeMessageBundle but after a while you will notice that your User entity implements too many interfaces...

```
class User implements SymfonyUserInterface, AcmeMessageBundleIdInterface, OtherBundleInterface, AcmeDemoBundleUserInterface, CompanyBundleIdentifierInterface, MyIndentifierInterface
{
  /* ... */
}
```

When we create **Symfony2** bundles we will always use the HappyR Identifier Interface for both public and interal work.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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

4517d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/401ccc5eea13c60cf807ae982af00e368e2166e2f26d8eb541dcd881a57385bc?d=identicon)[Nyholm](/maintainers/Nyholm)

---

Top Contributors

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

---

Tags

interfaceidentifierid

### Embed Badge

![Health badge](/badges/happyr-identifier-interface/health.svg)

```
[![Health](https://phpackages.com/badges/happyr-identifier-interface/health.svg)](https://phpackages.com/packages/happyr-identifier-interface)
```

###  Alternatives

[ramsey/uuid

A PHP library for generating and working with universally unique identifiers (UUIDs).

12.6k700.2M3.3k](/packages/ramsey-uuid)[nette/robot-loader

🍀 Nette RobotLoader: high performance and comfortable autoloader that will search and autoload classes within your application.

89152.7M321](/packages/nette-robot-loader)[pascaldevink/shortuuid

PHP 7.4+ library that generates concise, unambiguous, URL-safe UUIDs

5951.8M15](/packages/pascaldevink-shortuuid)[cybercog/laravel-optimus

An Optimus bridge for Laravel. Id obfuscation based on Knuth's multiplicative hashing method.

192564.1k](/packages/cybercog-laravel-optimus)[keiko/uuid-shortener

A simple shortener library for RFC 4122 compatible UUIDs. Change your 36 chars long UUID into it's shorter equivalent.

150215.4k2](/packages/keiko-uuid-shortener)[pugx/shortid-php

An implementation of shortid in PHP

52588.5k3](/packages/pugx-shortid-php)

PHPackages © 2026

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