Last active
November 21, 2016 12:38
-
-
Save SerafimArts/3ec650844d546ec19acbeae5f519d26e to your computer and use it in GitHub Desktop.
Yay! Example
This file contains hidden or 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 | |
@Some(a = 23, b = 42) | |
class TestClass | |
{ | |
public function test($a) | |
{ | |
} | |
} |
This file contains hidden or 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 | |
macro ·global ·unsafe { | |
@·ns()·class( | |
·ls ( | |
·chain (T_STRING·field, ·token('='), ·label()·value), | |
·token(',') | |
) | |
·fields | |
) | |
class T_STRING·class_name | |
} >> { | |
new class(new \ReflectionClass(T_STRING·class_name::class)) extends ·class { | |
public function __construct(\ReflectionClass $context) | |
{ | |
·fields ··· { | |
$this->T_STRING·field = ·value; | |
} | |
} | |
} | |
class T_STRING·class_name | |
} |
This file contains hidden or 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 | |
new class(new \ReflectionClass(TestClass::class)) extends Some { | |
public function __construct(\ReflectionClass $context) | |
{ | |
$this->a = 23; | |
$this->b = 42; | |
} | |
} | |
class TestClass | |
{ | |
public function test($a) | |
{ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment