-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix generating return statements when magic method returns void
- Loading branch information
1 parent
8835461
commit a527c9d
Showing
3 changed files
with
64 additions
and
3 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
49 changes: 49 additions & 0 deletions
49
tests/ProxyManagerTestAsset/ClassWithTypedMagicMethods.php
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,49 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace ProxyManagerTestAsset; | ||
|
||
/** | ||
* Base test class to play around with pre-existing typed magic methods | ||
* | ||
* @author Marco Pivetta <[email protected]> | ||
* @license MIT | ||
*/ | ||
class ClassWithTypedMagicMethods | ||
{ | ||
public array $data = []; | ||
|
||
public function __set(string|int $name, mixed $value): void | ||
{ | ||
$this->data[$name] = $value; | ||
} | ||
|
||
public function __get(string|int $name): mixed | ||
{ | ||
return $this->data[$name] ?? null; | ||
} | ||
|
||
public function __isset(string|int $name): bool | ||
{ | ||
return isset($this->data[$name]); | ||
} | ||
|
||
public function __unset(string|int $name): void | ||
{ | ||
unset($this->data[$name]); | ||
} | ||
|
||
public function __sleep(): array | ||
{ | ||
return ['data']; | ||
} | ||
|
||
public function __wakeup(): void | ||
{ | ||
} | ||
|
||
public function __clone(): void | ||
{ | ||
} | ||
} |