@@ -64,11 +64,17 @@ |
||
| 64 | 64 | $this->typeRegistry = $typeRegistry; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | + /** |
|
| 68 | + * @param string $name |
|
| 69 | + */ |
|
| 67 | 70 | public function define($name, $value = 1) |
| 68 | 71 | { |
| 69 | 72 | $this->defines[$name] = $value; |
| 70 | 73 | } |
| 71 | 74 | |
| 75 | + /** |
|
| 76 | + * @param string $name |
|
| 77 | + */ |
|
| 72 | 78 | public function undefine($name) |
| 73 | 79 | { |
| 74 | 80 | unset($this->defines[$name]); |
@@ -175,7 +175,7 @@ |
||
| 175 | 175 | return new $class($parent, $definition); |
| 176 | 176 | } elseif (isset(self::$classTypes[$format])) { |
| 177 | 177 | $type = self::$classTypes[$format]; |
| 178 | - $class = "\\SwaggerGen\\Swagger\\Type\\{$type}Type"; |
|
| 178 | + $class = "\\SwaggerGen\\Swagger\\Type\\{$type}type"; |
|
| 179 | 179 | return new $class($parent, $definition); |
| 180 | 180 | } else { |
| 181 | 181 | return new ReferenceObjectType($parent, $definition); |
@@ -111,7 +111,7 @@ |
||
| 111 | 111 | $this->Type = new $class($this, $definition); |
| 112 | 112 | } elseif (isset(self::$classTypes[$format])) { |
| 113 | 113 | $type = self::$classTypes[$format]; |
| 114 | - $class = "\\SwaggerGen\\Swagger\\Type\\{$type}Type"; |
|
| 114 | + $class = "\\SwaggerGen\\Swagger\\Type\\{$type}type"; |
|
| 115 | 115 | $this->Type = new $class($this, $definition); |
| 116 | 116 | } else { |
| 117 | 117 | throw new \SwaggerGen\Exception("Type format not recognized: '{$format}'"); |
@@ -22,8 +22,8 @@ discard block |
||
| 22 | 22 | * @copyright 2014-2017 Martijn van der Lee |
| 23 | 23 | * @license https://opensource.org/licenses/MIT MIT |
| 24 | 24 | */ |
| 25 | -class TypeRegistry |
|
| 26 | -{
|
|
| 25 | +class TypeRegistry |
|
| 26 | +{ |
|
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | 29 | * Map of format-name => class-name |
@@ -37,10 +37,10 @@ discard block |
||
| 37 | 37 | * |
| 38 | 38 | * @param type $classname |
| 39 | 39 | */ |
| 40 | - public function add($classname) |
|
| 41 | - {
|
|
| 42 | - if (is_subclass_of($classname, '\\SwaggerGen\\Swagger\\Type\\AbstractType', true)) {
|
|
| 43 | - foreach ($classname::getFormats() as $format) {
|
|
| 40 | + public function add($classname) |
|
| 41 | + { |
|
| 42 | + if (is_subclass_of($classname, '\\SwaggerGen\\Swagger\\Type\\AbstractType', true)) { |
|
| 43 | + foreach ($classname::getFormats() as $format) { |
|
| 44 | 44 | $this->formats[$format] = $classname; |
| 45 | 45 | } |
| 46 | 46 | } |
@@ -51,8 +51,8 @@ discard block |
||
| 51 | 51 | * |
| 52 | 52 | * @param string $name |
| 53 | 53 | */ |
| 54 | - public function remove($name) |
|
| 55 | - {
|
|
| 54 | + public function remove($name) |
|
| 55 | + { |
|
| 56 | 56 | $this->formats[$name] = null; |
| 57 | 57 | } |
| 58 | 58 | |
@@ -61,8 +61,8 @@ discard block |
||
| 61 | 61 | * |
| 62 | 62 | * @return bool |
| 63 | 63 | */ |
| 64 | - public function has($name) |
|
| 65 | - {
|
|
| 64 | + public function has($name) |
|
| 65 | + { |
|
| 66 | 66 | return !empty($this->formats[$name]); |
| 67 | 67 | } |
| 68 | 68 | |
@@ -71,8 +71,8 @@ discard block |
||
| 71 | 71 | * |
| 72 | 72 | * @return null|string |
| 73 | 73 | */ |
| 74 | - public function get($name) |
|
| 75 | - {
|
|
| 74 | + public function get($name) |
|
| 75 | + { |
|
| 76 | 76 | return !empty($this->formats[$name]) ? $this->formats[$name] : null; |
| 77 | 77 | } |
| 78 | 78 | |