-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow decorating anonymous classes; Allow direct access to public var…
…iables
- Loading branch information
Coil
committed
Dec 30, 2021
1 parent
a1b8094
commit 0e74e2b
Showing
4 changed files
with
79 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace C01l\PhpDecorator; | ||
|
||
trait ProxyVariableAccessTrait | ||
{ | ||
public function __set(string $name, $value): void | ||
{ | ||
$this->real->$name = $value; | ||
} | ||
|
||
public function __get(string $name) | ||
{ | ||
return $this->real->$name; | ||
} | ||
|
||
public function __isset(string $name): bool | ||
{ | ||
return isset($this->real->$name); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters