| @@ 1600-1602 (lines=3) @@ | ||
| 1597 | ||
| 1598 | // turn list of length 1 into value type |
|
| 1599 | protected function flattenList($value) { |
|
| 1600 | if ($value[0] == "list" && count($value[2]) == 1) { |
|
| 1601 | return $this->flattenList($value[2][0]); |
|
| 1602 | } |
|
| 1603 | return $value; |
|
| 1604 | } |
|
| 1605 | ||
| @@ 2956-2960 (lines=5) @@ | ||
| 2953 | ||
| 2954 | protected function stripDefault(&$value) { |
|
| 2955 | $def = end($value[2]); |
|
| 2956 | if ($def[0] == "keyword" && $def[1] == "!default") { |
|
| 2957 | array_pop($value[2]); |
|
| 2958 | $value = $this->flattenList($value); |
|
| 2959 | return true; |
|
| 2960 | } |
|
| 2961 | ||
| 2962 | if ($def[0] == "list") { |
|
| 2963 | return $this->stripDefault($value[2][count($value[2]) - 1]); |
|
| @@ 4019-4021 (lines=3) @@ | ||
| 4016 | ||
| 4017 | // turn list of length 1 into value type |
|
| 4018 | protected function flattenList($value) { |
|
| 4019 | if ($value[0] == "list" && count($value[2]) == 1) { |
|
| 4020 | return $this->flattenList($value[2][0]); |
|
| 4021 | } |
|
| 4022 | return $value; |
|
| 4023 | } |
|
| 4024 | } |
|