@@ -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 | } |
@@ -28,8 +28,9 @@ |
||
28 | 28 | |
29 | 29 | $reference = null; |
30 | 30 | if ($type === 'refobject') { |
31 | - if (isset($match[2])) |
|
32 | - $reference = $match[2]; |
|
31 | + if (isset($match[2])) { |
|
32 | + $reference = $match[2]; |
|
33 | + } |
|
33 | 34 | } else { |
34 | 35 | $reference = $match[1]; |
35 | 36 | } |
@@ -10,7 +10,8 @@ |
||
10 | 10 | * @copyright 2014-2015 Martijn van der Lee |
11 | 11 | * @license https://opensource.org/licenses/MIT MIT |
12 | 12 | */ |
13 | -interface IParameter { |
|
13 | +interface IParameter |
|
14 | +{ |
|
14 | 15 | |
15 | 16 | public function getName(); |
16 | 17 | } |
@@ -69,7 +69,8 @@ discard block |
||
69 | 69 | } |
70 | 70 | } |
71 | 71 | |
72 | - private function extractStatements() { |
|
72 | + private function extractStatements() |
|
73 | + { |
|
73 | 74 | // Core comments |
74 | 75 | $Statements = $this->Statements; |
75 | 76 | |
@@ -215,7 +216,8 @@ discard block |
||
215 | 216 | } |
216 | 217 | } |
217 | 218 | |
218 | - private function parseTokens($source) { |
|
219 | + private function parseTokens($source) |
|
220 | + { |
|
219 | 221 | $mode = null; |
220 | 222 | $namespace = ''; |
221 | 223 | |
@@ -340,7 +342,8 @@ discard block |
||
340 | 342 | |
341 | 343 | $match = null; |
342 | 344 | foreach ($Statements as $Statement) { |
343 | - if ($Statement->command === 'uses' || $Statement->command === 'see') { //@todo either one, not both? |
|
345 | + if ($Statement->command === 'uses' || $Statement->command === 'see') { |
|
346 | +//@todo either one, not both? |
|
344 | 347 | if (preg_match('/^((?:\\w+)|\$this)(?:(::|->)(\\w+))?(?:\\(\\))?$/', strtolower($Statement->data), $match) === 1) { |
345 | 348 | if (count($match) >= 3) { |
346 | 349 | $Class = null; |
@@ -169,7 +169,8 @@ discard block |
||
169 | 169 | $this->Tags[] = $Tag; |
170 | 170 | } |
171 | 171 | |
172 | - if ($command === 'api') { // backwards compatibility |
|
172 | + if ($command === 'api') { |
|
173 | +// backwards compatibility |
|
173 | 174 | $this->defaultTag = $Tag; |
174 | 175 | } |
175 | 176 | return $Tag; |
@@ -276,7 +277,8 @@ discard block |
||
276 | 277 | return __CLASS__; |
277 | 278 | } |
278 | 279 | |
279 | - public function resolveReference($name) { |
|
280 | + public function resolveReference($name) |
|
281 | + { |
|
280 | 282 | if (isset($this->definitions[$name])) { |
281 | 283 | return '#/definitions/' . $name; |
282 | 284 | } |