| 1 | <?php |
||
| 14 | class ScopePointer |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * @var ClassMethod|FunctionDefinition |
||
| 18 | */ |
||
| 19 | protected $object; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Initializes the scopePointer with an object |
||
| 23 | * |
||
| 24 | * @param $object |
||
| 25 | */ |
||
| 26 | 46 | public function __construct($object) |
|
| 30 | |||
| 31 | /** |
||
| 32 | * Is the object a class method? |
||
| 33 | * |
||
| 34 | * @return bool |
||
| 35 | */ |
||
| 36 | 38 | public function isClassMethod() |
|
| 40 | |||
| 41 | /** |
||
| 42 | * Is the object a function? |
||
| 43 | * |
||
| 44 | * @return bool |
||
| 45 | */ |
||
| 46 | 6 | public function isFunction() |
|
| 47 | { |
||
| 48 | 6 | return $this->object instanceof FunctionDefinition; |
|
| 49 | } |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Returns the object. |
||
| 53 | * |
||
| 54 | * @return ClassMethod|FunctionDefinition |
||
| 55 | */ |
||
| 56 | 35 | public function getObject() |
|
| 60 | } |
||
| 61 |