| @@ 21-33 (lines=13) @@ | ||
| 18 | { |
|
| 19 | $this->map[$constant] = $constant; |
|
| 20 | } |
|
| 21 | public function all() |
|
| 22 | { |
|
| 23 | $consts = $this->map; |
|
| 24 | $parent = $this->class->getParent(); |
|
| 25 | if ($parent instanceof ClassData) { |
|
| 26 | $consts = array_merge( |
|
| 27 | $parent->properties->all(), |
|
| 28 | $consts |
|
| 29 | ); |
|
| 30 | } |
|
| 31 | sort($consts); |
|
| 32 | return $consts; |
|
| 33 | } |
|
| 34 | public function get($propName) |
|
| 35 | { |
|
| 36 | if (array_key_exists($propName, $this->map)) { |
|
| @@ 34-44 (lines=11) @@ | ||
| 31 | sort($consts); |
|
| 32 | return $consts; |
|
| 33 | } |
|
| 34 | public function get($propName) |
|
| 35 | { |
|
| 36 | if (array_key_exists($propName, $this->map)) { |
|
| 37 | $const = $this->map[$propName]; |
|
| 38 | return $const; |
|
| 39 | } |
|
| 40 | $parent = $this->class->getParent(); |
|
| 41 | if ($parent instanceof ClassData) { |
|
| 42 | return $parent->properties->get($propName); |
|
| 43 | } |
|
| 44 | } |
|
| 45 | ||
| 46 | private $map = []; |
|
| 47 | private $class; |
|