| 1 | <?php |
||
| 11 | class ScopePointer |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var ClassMethod|FunctionDefinition |
||
| 15 | */ |
||
| 16 | protected $object; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Initializes the scopePointer with an object |
||
| 20 | * |
||
| 21 | * @param $object |
||
| 22 | */ |
||
| 23 | 27 | public function __construct($object) |
|
| 27 | |||
| 28 | /** |
||
| 29 | * Is the object a class method? |
||
| 30 | * |
||
| 31 | * @return bool |
||
| 32 | */ |
||
| 33 | 27 | public function isClassMethod() |
|
| 37 | |||
| 38 | /** |
||
| 39 | * Is the object a function? |
||
| 40 | * |
||
| 41 | * @return bool |
||
| 42 | */ |
||
| 43 | 6 | public function isFunction() |
|
| 44 | { |
||
| 45 | 6 | return $this->object instanceof FunctionDefinition; |
|
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Returns the object. |
||
| 50 | * |
||
| 51 | * @return ClassMethod|FunctionDefinition |
||
| 52 | */ |
||
| 53 | 23 | public function getObject() |
|
| 57 | } |
||
| 58 |