m0rtis / picklock
One class package for calling protected and private methods without reflection
1.0.1
2018-06-15 19:27 UTC
Requires
- php: ^7.2
Requires (Dev)
- phpunit/phpunit: ^7.0
This package is auto-updated.
Last update: 2024-10-19 09:39:56 UTC
README
Tiny package that allows direct access to any protected or private method of an object without reflection. For example for testing.
Installing
The best way is to install this package via composer:
composer require m0rtis/picklock
How to use
It is very simple:
m0rtis\Picklock\Picklock::callMethod(object $object, string $methodName, [$argementOne[, $argumentTwo, ...]]);
$object - The object whose method you want to call
$methodName - Name of the method you want to call
$arguments - Any arguments you need to call your method
Versioning
We use SemVer for versioning. For the versions available, see the tags on this repository.
Author
Anton Fomichev aka m0rtis - mail@m0rtis.ru
License
This project is licensed under the Apache 2.0 license - see the LICENSE file for details