1 | <?php |
||
19 | class FunctionDefinition extends ParentDefinition |
||
20 | { |
||
21 | /** |
||
22 | * @todo Use Finder |
||
23 | * |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $filepath; |
||
27 | |||
28 | /** |
||
29 | * @var Node\Stmt\Function_ |
||
30 | */ |
||
31 | protected $statement; |
||
32 | |||
33 | /** |
||
34 | * @var int |
||
35 | */ |
||
36 | protected $returnTypes = CompiledExpression::MIXED; |
||
37 | |||
38 | /** |
||
39 | * @var array |
||
40 | */ |
||
41 | protected $possibleReturnTypes = []; |
||
42 | |||
43 | /** |
||
44 | * @param string $name |
||
45 | * @param Node\Stmt\Function_ $statement |
||
46 | */ |
||
47 | 5 | public function __construct($name, Node\Stmt\Function_ $statement) |
|
52 | |||
53 | /** |
||
54 | * Compile function to check it |
||
55 | * |
||
56 | * @param Context $context |
||
57 | * @return bool |
||
58 | */ |
||
59 | 5 | public function compile(Context $context) |
|
104 | |||
105 | /** |
||
106 | * @return string |
||
107 | */ |
||
108 | 5 | public function getFilepath() |
|
112 | |||
113 | /** |
||
114 | * @param string $filepath |
||
115 | */ |
||
116 | 5 | public function setFilepath($filepath) |
|
120 | |||
121 | /** |
||
122 | * @return string |
||
123 | */ |
||
124 | public function getNamespace() |
||
128 | |||
129 | /** |
||
130 | * @return Node\Param[] |
||
131 | */ |
||
132 | 1 | public function getParams() |
|
136 | } |
||
137 |