Created
November 2, 2016 12:31
-
-
Save vinyvicente/779e85732e824c4d491fb257b058775a to your computer and use it in GitHub Desktop.
Setters create objects dynamically
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
<?php | |
public function __call($name, $arguments) | |
{ | |
echo ' | |
/** | |
* @var string | |
*/ | |
protected $' . lcfirst(mb_substr($name, 3, mb_strlen($name) - 3)) . ';' . PHP_EOL; | |
return $this; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment