nixxxon/overloader

Overloader - Overload object methods and properties


Keywords
override, Overload
License
MIT

Documentation

Overloader

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

Overload object methods and properties

Install

Via Composer

$ composer require nixxxon/overloader

Usage

class Foo
{
    protected $bar = 'bar';

    protected function getBar()
    {
        return $this->getBarForReal();
    }

    private function getBarForReal()
    {
        return $this->bar;

    }
}

$object = new Foo;
$overload = \Nixxxon\Overloader\Overloader::init($object);
$overload->method('getBarForReal', function () {
    return 'NOT BAR';
});
echo $overload->getBar(); // NOT BAR

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email niclas.aberg@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.