| 1 | <?php |
||
| 12 | class TraitDefinition extends ParentDefinition |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @var string |
||
| 16 | */ |
||
| 17 | protected $filepath; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @var Stmt\Trait_ |
||
| 21 | */ |
||
| 22 | protected $statement; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @var ClassMethod[] |
||
| 26 | */ |
||
| 27 | protected $methods = []; |
||
| 28 | |||
| 29 | 1 | public function __construct($name, Stmt\Trait_ $statement) |
|
| 34 | |||
| 35 | /** |
||
| 36 | * Compile the definition |
||
| 37 | * |
||
| 38 | * @param Context $context |
||
| 39 | * @return boolean |
||
| 40 | */ |
||
| 41 | 1 | public function compile(Context $context) |
|
| 55 | |||
| 56 | /** |
||
| 57 | * @return string |
||
| 58 | */ |
||
| 59 | 1 | public function getFilepath() |
|
| 63 | |||
| 64 | /** |
||
| 65 | * @param string $filepath |
||
| 66 | */ |
||
| 67 | 1 | public function setFilepath($filepath) |
|
| 71 | |||
| 72 | /** |
||
| 73 | * @return bool |
||
| 74 | */ |
||
| 75 | 1 | public function precompile() |
|
| 85 | |||
| 86 | /** |
||
| 87 | * @param $method |
||
| 88 | */ |
||
| 89 | public function addMethod($method) |
||
| 93 | |||
| 94 | /** |
||
| 95 | * @return ClassMethod[] |
||
| 96 | */ |
||
| 97 | public function getMethods() |
||
| 101 | } |
||
| 102 |