@@ -151,6 +151,9 @@ |
||
| 151 | 151 | )); |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | + /** |
|
| 155 | + * @return string |
|
| 156 | + */ |
|
| 154 | 157 | protected function validateDefault($value) |
| 155 | 158 | { |
| 156 | 159 | if (empty($value)) { |
@@ -154,7 +154,7 @@ |
||
| 154 | 154 | protected function validateDefault($value) |
| 155 | 155 | { |
| 156 | 156 | if (empty($value)) { |
| 157 | - throw new \SwaggerGen\Exception("Empty {$this->type} default"); |
|
| 157 | + throw new \SwaggerGen\Exception("empty {$this->type} default"); |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | if (!empty($this->enum) && !in_array($value, $this->enum)) { |
@@ -72,7 +72,7 @@ |
||
| 72 | 72 | // Internal type if type known and not overwritten by definition |
| 73 | 73 | if (isset(self::$classTypes[$format])) { |
| 74 | 74 | $type = self::$classTypes[$format]; |
| 75 | - $class = "SwaggerGen\\Swagger\\Type\\{$type}Type"; |
|
| 75 | + $class = "SwaggerGen\\Swagger\\Type\\{$type}type"; |
|
| 76 | 76 | $this->type = new $class($this, $definition); |
| 77 | 77 | } else { |
| 78 | 78 | $this->type = new Type\ReferenceObjectType($this, $definition); |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | $match = array(); |
| 46 | 46 | if (preg_match(self::REGEX_START . self::REGEX_FORMAT . self::REGEX_DEFAULT_START . $this->regex . self::REGEX_DEFAULT_END . self::REGEX_END, $definition, $match) !== 1) { |
| 47 | - throw new \SwaggerGen\Exception("Unparseable {$this->type} definition: '{$definition}'"); |
|
| 47 | + throw new \SwaggerGen\Exception("unparseable {$this->type} definition: '{$definition}'"); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | if (strtolower($match[1] !== $this->type)) { |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $value = parent::validateDefault($value); |
| 61 | 61 | |
| 62 | 62 | if (preg_match('/' . $this->pattern . '/', $value) !== 1) { |
| 63 | - throw new \SwaggerGen\Exception("Invalid {$this->type} default value"); |
|
| 63 | + throw new \SwaggerGen\Exception("invalid {$this->type} default value"); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | return $value; |
@@ -199,7 +199,8 @@ discard block |
||
| 199 | 199 | $this->tags[] = $Tag; |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | - if ($command === 'api') { // backwards compatibility |
|
| 202 | + if ($command === 'api') { |
|
| 203 | +// backwards compatibility |
|
| 203 | 204 | $this->defaultTag = $Tag; |
| 204 | 205 | } |
| 205 | 206 | return $Tag; |
@@ -330,7 +331,8 @@ discard block |
||
| 330 | 331 | * @param string $name |
| 331 | 332 | * @return boolean |
| 332 | 333 | */ |
| 333 | - public function hasDefinition($name) { |
|
| 334 | + public function hasDefinition($name) |
|
| 335 | + { |
|
| 334 | 336 | return isset($this->definitions[$name]); |
| 335 | 337 | } |
| 336 | 338 | |