PHPackages                             hail/singleton - 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. [Framework](/categories/framework)
4. /
5. hail/singleton

ActiveLibrary[Framework](/categories/framework)

hail/singleton
==============

Singleton pattern

v2.0.0(4y ago)0333MITPHPPHP &gt;=8.0.0

Since May 20Pushed 4y ago1 watchersCompare

[ Source](https://github.com/hail-framework/singleton)[ Packagist](https://packagist.org/packages/hail/singleton)[ Docs](http://framework.flyinghail.com/)[ RSS](/packages/hail-singleton/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (3)

Singleton
=========

[](#singleton)

Singleton pattern for PHP

Example
=======

[](#example)

```
class Example
{
    use Hail\Singleton\SingletonTrait;

    private $var;

    protected function init(): void
    {
        $this->var = 0;
    }
}

$example = Example::getInstance();
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity65

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

Every ~809 days

Total

2

Last Release

1742d ago

Major Versions

v1.0.0 → v2.0.02021-08-06

PHP version history (2 changes)v1.0.0PHP &gt;=7.1.3

v2.0.0PHP &gt;=8.0.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/157430?v=4)[FENG Hao](/maintainers/flyinghail)[@flyinghail](https://github.com/flyinghail)

---

Top Contributors

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

---

Tags

frameworksingletonHail

### Embed Badge

![Health badge](/badges/hail-singleton/health.svg)

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

###  Alternatives

[pestphp/pest-plugin-stressless

Stressless plugin for Pest

67792.6k16](/packages/pestphp-pest-plugin-stressless)

PHPackages © 2026

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