PHPackages                             emados/php-statical - 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. emados/php-statical

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

emados/php-statical
===================

Allows for easy aliases creation that proxies static calls to a single instance of a class.

v0.1(9y ago)0516MITPHP

Since Jul 25Pushed 9y ago1 watchersCompare

[ Source](https://github.com/emados/php-statical)[ Packagist](https://packagist.org/packages/emados/php-statical)[ RSS](/packages/emados-php-statical/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

php-statical
============

[](#php-statical)

Allows for easy aliases creation that proxies static calls to a single instance of a class.

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

[](#installation)

```
composer require emados/php-statical
```

Usage
-----

[](#usage)

Create an alias class that will serve as a statical proxy for a specific class. For example, for a class named `App\Core\Language` you can either create an alias class for it in the same namespace but with a different name `App\Core\Lang` or use the same name in a different namespace `\Language` or both `Lang`.

```
final class Lang {
    use Statical;

    protected function targetClassInstance() {
        return new \App\Core\Language();
    }
}
```

Now, you can use the proxy class will create a single instance for the target class, and allow to access all its public api statically.

Notice
------

[](#notice)

If you're using an IDE with the auto-complete feature, you probably now that it won't work with proxy classes (aliases), you can workaround this by using phpdoc annotations, although this will require you to update the docs of the proxy class each time you update the target class api.

```
/**
 * @method static string current() Returns current language code.
 * @method static void force(string $lang) Forces using a specific language code.
 * ...
 */
final class Lang {
    use Statical;

    protected function targetClassInstance() {
        return new \App\Core\Language();
    }
}
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% 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

3581d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4d39141db08a7da6d1630a0f3a4c1f7ca7eed56a2ecc3e51540653eab0fe472f?d=identicon)[EmadOmar](/maintainers/EmadOmar)

---

Top Contributors

[![emadzz](https://avatars.githubusercontent.com/u/4407763?v=4)](https://github.com/emadzz "emadzz (3 commits)")[![emados](https://avatars.githubusercontent.com/u/125161569?v=4)](https://github.com/emados "emados (1 commits)")

### Embed Badge

![Health badge](/badges/emados-php-statical/health.svg)

```
[![Health](https://phpackages.com/badges/emados-php-statical/health.svg)](https://phpackages.com/packages/emados-php-statical)
```

PHPackages © 2026

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