PHPackages                             ailixter/gears-overloading - 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. ailixter/gears-overloading

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

ailixter/gears-overloading
==========================

The project, which Gears Overloading.

0.1.2(6y ago)031MITPHPPHP ^7

Since Nov 19Pushed 6y ago1 watchersCompare

[ Source](https://github.com/ailixter/gears-overloading)[ Packagist](https://packagist.org/packages/ailixter/gears-overloading)[ RSS](/packages/ailixter-gears-overloading/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (1)Versions (4)Used By (1)

gears-overloading
=================

[](#gears-overloading)

install
-------

[](#install)

composer require ailixter/gears-overloading

howtos
------

[](#howtos)

### How to provide getter/setter overriding for properties

[](#how-to-provide-gettersetter-overriding-for-properties)

```
use Ailixter\Gears\Props;

class TestProps
{
    use Props;

    private $myPri = 'my private';

    public function getMyPri() {
        return '*' . $this->myPri;
    }
}

$test = new TestProps;
echo $test->myPri;
$test->myPri = 'new'; // PropertyException
```

or, for real (defined) props:

```
class TestRealProps
{
    use Props;

    private $myPri = 'my private';

    protected function propertyGet($prop)
    {
        return $this->{$prop};
    }

    protected function propertySet($prop, $value)
    {
        $this->{$prop} = $value;
    }
}

$test = new TestRealProps;
echo $test->myPri;
$test->myPri = 'new';
echo $test->undefined;     // Notice
$test->undefined = 'some'; // perfectly ok
```

### How to support explicitely defined properties only

[](#how-to-support-explicitely-defined-properties-only)

```
use Ailixter\Gears\StrictProps;

class TestStrictProps
{
    use StrictProps;

    private $myPri = 'my private';
}

$test = new TestStrictProps;
echo $test->myPri;
$test->myPri = 'new';
echo $test->undefined;     // PropertyException
$test->undefined = 'some'; // PropertyException
```

### How to create getters and fluent setters for all defined props

[](#how-to-create-getters-and-fluent-setters-for-all-defined-props)

```
use Ailixter\Gears\AutoGetSetProps;

class TestAutoGetSetProps
{
    use AutoGetSetProps;

    private $myPri;
}

$test = TestAutoGetSetProps;
echo $test->setMyPri('new')->getMyPri();
```

it's also possible to specify defaults in getters:

```
class TestAutoGetPropsWithDefaults
{
    use Props, AutoGetSetProps;

    private   $myPri;
    protected $myPro;

    public function getMyPro($default = 'static default')
    {
        return $this->existingProperty('myPro', $default);
    }
}

$test = TestAutoGetSetProps;
echo $test->myPro;                       // static default
echo $test->getMyPri('dynamic default'); // dynamic default
```

### How to implement property binding

[](#how-to-implement-property-binding)

This enables you to *delegate* procedural property getting/setting.

```
use Ailixter\Gears\BoundProps;

class TestBoundProps
{
    use BoundProps;

    /** @var BoundPropsInterface */
    private $myBoundPri;
}

$test = new TestBoundProps;
$test->myBoundPri = new TestPropsBinding;
$test->myBoundPri = 'new';
echo $test->myBoundPri;
```

### How to proxy your objects

[](#how-to-proxy-your-objects)

```
use Ailixter\Gears\AbstractProxy;

class TestProxy extends AbstractProxy {}

class TestObject {
    public $myPub = 'my public';
    public function myFn () {
        return __function__;
    }
}

$test = new TestProxy(new TestObject);
echo $test->myPub;
$test->myPub = 'new';
echo $this->myFn();
```

or

```
class CustomProxy
{
    use Proxy;

    private $proxiedObject;

    public function __construct($proxiedObject)
    {
        $this->proxiedObject = $proxiedObject;
    }
}
```

or

```
class LazyProxy
{
    use Proxy;

    private $obj;

    protected function getProxiedObject()
    {
        if (!$this->obj instanceof ProxiedObject) {
            $this->obj = new ProxiedObject;
        }
        return $this->obj;
    }
}
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity53

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 ~135 days

Total

3

Last Release

2460d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

componentdynamic-propsfacadeoverloadingproxy

### Embed Badge

![Health badge](/badges/ailixter-gears-overloading/health.svg)

```
[![Health](https://phpackages.com/badges/ailixter-gears-overloading/health.svg)](https://phpackages.com/packages/ailixter-gears-overloading)
```

PHPackages © 2026

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