Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
2 / 2 |
| Proxy | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
| __construct | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
| 1 | <?php |
| 2 | |
| 3 | namespace Amf; |
| 4 | |
| 5 | /** |
| 6 | * Proxy class. |
| 7 | * |
| 8 | * This class can be used to proxy function calls and property access to |
| 9 | * a given object. |
| 10 | * By extending this class you can implement alternative method |
| 11 | * implementation and accessors/mutators to the proxied object. |
| 12 | * |
| 13 | * @template T of object |
| 14 | * @mixin T |
| 15 | */ |
| 16 | class Proxy |
| 17 | { |
| 18 | use Proxy\Proxiable; |
| 19 | |
| 20 | /** @var T */ |
| 21 | protected object $object; |
| 22 | |
| 23 | /** |
| 24 | * Constructor. |
| 25 | * |
| 26 | * The class needs the object to be proxied when being initialized. |
| 27 | * |
| 28 | * @param T $object |
| 29 | */ |
| 30 | public function __construct(object $object) |
| 31 | { |
| 32 | $this->object = $object; |
| 33 | } |
| 34 | } |