tasoft / value-injector
Installs: 291
Dependents: 7
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/tasoft/value-injector
Requires
- php: ^7|^8
Requires (Dev)
- phpunit/phpunit: ^6|^9
This package is auto-updated.
Last update: 2025-10-08 02:20:40 UTC
README
The value injector object is a proxy that allows you to get, set or call non-accessible attributes of another object.
Install
$ composer require tasoft/value-injector
How it works
<?php use TASoft\Util\ValueInjector; class PrivateClass { private $value; public function getValue() { return $this->value; } } $myObject = new PrivateClass(); echo $myObject->value; // Will fail echo $myObject->getValue(); // Works // But if you want to set the value, use my value injector: $vi = new ValueInjector($myObject); $vi->value = 23; echo $myObject->getValue(); // 23