Total Complexity | 4 |
Total Lines | 33 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
16 | class PropertyUpdater implements UpdatesTheProxyOwner |
||
17 | { |
||
18 | private $owner; |
||
19 | private $propertyShouldReference; |
||
20 | private $setter; |
||
21 | |||
22 | public function __construct( |
||
23 | $theOwner, |
||
24 | string $theProperty, |
||
25 | Closure $setter = null |
||
26 | ) { |
||
27 | $this->owner = $theOwner; |
||
28 | $this->propertyShouldReference = $theProperty; |
||
29 | $this->setter = $setter ?: function (string $property, $value) : void |
||
30 | { |
||
31 | $this->$property = $value; |
||
32 | }; |
||
33 | } |
||
34 | |||
35 | public static function for( |
||
42 | } |
||
43 | |||
44 | public function updateWith($theLoadedInstance) : void |
||
49 | ); |
||
50 | } |
||
52 |