@@ -2,9 +2,9 @@ |
||
2 | 2 | |
3 | 3 | require_once __DIR__ . '/autoloader.php'; |
4 | 4 | |
5 | - $files = array('Example.class.php'); |
|
5 | + $files = array('Example.class.php'); |
|
6 | 6 | |
7 | - $SwaggerGen = new \SwaggerGen\SwaggerGen($_SERVER['HTTP_HOST'], dirname($_SERVER['REQUEST_URI'])); |
|
7 | + $SwaggerGen = new \SwaggerGen\SwaggerGen($_SERVER['HTTP_HOST'], dirname($_SERVER['REQUEST_URI'])); |
|
8 | 8 | //$SwaggerGen->define('admin'); |
9 | 9 | //$SwaggerGen->define('root'); |
10 | 10 |
@@ -58,7 +58,7 @@ |
||
58 | 58 | if (!$this->handle($match[1], $match[2]) && $this->getState()) { |
59 | 59 | $output .= $line; |
60 | 60 | } else { |
61 | - $output .= str_replace('@'.$this->getPrefix(), '!'.$this->getPrefix(), $line); |
|
61 | + $output .= str_replace('@' . $this->getPrefix(), '!' . $this->getPrefix(), $line); |
|
62 | 62 | } |
63 | 63 | } else { |
64 | 64 | $output .= $line; |
@@ -38,7 +38,7 @@ |
||
38 | 38 | 'datetime' => 'Date', |
39 | 39 | 'date-time' => 'Date', |
40 | 40 | 'object' => 'Object', |
41 | - 'refobject' => 'ReferenceObject', |
|
41 | + 'refobject' => 'ReferenceObject', |
|
42 | 42 | //'file' => 'File'; |
43 | 43 | //'set' => 'EnumArray'; |
44 | 44 | ); |
@@ -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 | } |