PHPackages                             javalikeenum/enum - 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. javalikeenum/enum

ActiveLibrary

javalikeenum/enum
=================

v0.1.0(6y ago)01.2k[1 issues](https://github.com/ytetsuro/php-javalike-enum/issues)MITPHPPHP &gt;=5.6.0CI failing

Since Dec 19Pushed 6y ago1 watchersCompare

[ Source](https://github.com/ytetsuro/php-javalike-enum)[ Packagist](https://packagist.org/packages/javalikeenum/enum)[ RSS](/packages/javalikeenum-enum/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

This is Java like enum for PHP.
===============================

[](#this-is-java-like-enum-for-php)

@todo

Install
-------

[](#install)

```
composer require javalikeenum/enum

```

Using
-----

[](#using)

create enum.

```
use JavaLikeEnum\Enum;

final class ItemType{
  use Enum;

  const FOOD = 1;
  const SERVICE = 2;
  const DRINK = 3;
}

assert(ItemType::FOOD() === ItemType::FOOD());

try {
  $a = clone ItemType::FOOD();
} catch (LogicException $e) {
  assert(true);
}

assert(ItemType::values() === [ItemType::FOOD(), ItemType::SERVICE(), ItemType::DRINK()]);
assert('1' === (string) ItemType::FOOD());
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

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

2343d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/174d9ce493a4c9df33291a567c81c64011b8e64e8e7c882c4194781e5863cc45?d=identicon)[ytetsuro](/maintainers/ytetsuro)

---

Tags

enumjavalikephp5simple

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/javalikeenum-enum/health.svg)

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

PHPackages © 2026

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