A small PHP library to access private/protected properties/methods of objects
The recommended method of installing this library is via Composer.
Run the following command from your project root:
$ composer require duncan3dc/object-intruder
use duncan3dc\ObjectIntruder\Intruder; $table = new Intruder(new Table); $table->secretMethodNotPublic("Hello", "World"); $table->privateStuff = "modified";
Unfortunatly due to a limitation of __call methods with parameters passed by reference are not supported.
However there is a workaround available using the
$stuff = "start"; $table = new Intruder(new Table); $table->_call("secretMethod", $stuff, Table::MODIFY);
A Changelog has been available since the beginning of time