| 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) |
|
| 53 | |||
| 54 | /** |
||
| 55 | * @return string |
||
| 56 | */ |
||
| 57 | 1 | public function getFilepath() |
|
| 58 | { |
||
| 59 | 1 | return $this->filepath; |
|
| 60 | } |
||
| 61 | |||
| 62 | /** |
||
| 63 | * @param string $filepath |
||
| 64 | */ |
||
| 65 | 1 | public function setFilepath($filepath) |
|
| 69 | |||
| 70 | /** |
||
| 71 | * @return bool |
||
| 72 | */ |
||
| 73 | 1 | public function precompile() |
|
| 83 | |||
| 84 | /** |
||
| 85 | * @param $method |
||
| 86 | */ |
||
| 87 | public function addMethod($method) |
||
| 91 | |||
| 92 | /** |
||
| 93 | * @return ClassMethod[] |
||
| 94 | */ |
||
| 95 | public function getMethods() |
||
| 99 | } |
||
| 100 |