@@ -17,26 +17,26 @@ |
||
| 17 | 17 | |
| 18 | 18 | protected function parseDefinition($definition) |
| 19 | 19 | { |
| 20 | - $definition = self::trim($definition); |
|
| 21 | - |
|
| 22 | - $match = array(); |
|
| 23 | - if (preg_match(self::REGEX_START . self::REGEX_FORMAT . self::REGEX_CONTENT . self::REGEX_RANGE . self::REGEX_DEFAULT . self::REGEX_END, $definition, $match) !== 1) { |
|
| 24 | - throw new \SwaggerGen\Exception("Unparseable string definition: '{$definition}'"); |
|
| 25 | - } |
|
| 26 | - |
|
| 27 | - $type = strtolower($match[1]); |
|
| 28 | - |
|
| 29 | - $reference = null; |
|
| 30 | - if ($type === 'refobject') { |
|
| 31 | - if (isset($match[2])) |
|
| 32 | - $reference = $match[2]; |
|
| 33 | - } else { |
|
| 34 | - $reference = $match[1]; |
|
| 35 | - } |
|
| 36 | - |
|
| 37 | - if (empty($reference)) { |
|
| 38 | - throw new \SwaggerGen\Exception("Referenced object name missing: '{$definition}'"); |
|
| 39 | - } |
|
| 20 | + $definition = self::trim($definition); |
|
| 21 | + |
|
| 22 | + $match = array(); |
|
| 23 | + if (preg_match(self::REGEX_START . self::REGEX_FORMAT . self::REGEX_CONTENT . self::REGEX_RANGE . self::REGEX_DEFAULT . self::REGEX_END, $definition, $match) !== 1) { |
|
| 24 | + throw new \SwaggerGen\Exception("Unparseable string definition: '{$definition}'"); |
|
| 25 | + } |
|
| 26 | + |
|
| 27 | + $type = strtolower($match[1]); |
|
| 28 | + |
|
| 29 | + $reference = null; |
|
| 30 | + if ($type === 'refobject') { |
|
| 31 | + if (isset($match[2])) |
|
| 32 | + $reference = $match[2]; |
|
| 33 | + } else { |
|
| 34 | + $reference = $match[1]; |
|
| 35 | + } |
|
| 36 | + |
|
| 37 | + if (empty($reference)) { |
|
| 38 | + throw new \SwaggerGen\Exception("Referenced object name missing: '{$definition}'"); |
|
| 39 | + } |
|
| 40 | 40 | |
| 41 | 41 | $this->reference = $reference; |
| 42 | 42 | } |