| @@ 131-139 (lines=9) @@ | ||
| 128 | } |
|
| 129 | ||
| 130 | switch (strtolower($command)) { |
|
| 131 | case 'min': |
|
| 132 | $this->minItems = intval($data); |
|
| 133 | if ($this->minItems < 0) { |
|
| 134 | throw new \SwaggerGen\Exception("Minimum less than zero: '{$data}'"); |
|
| 135 | } |
|
| 136 | if ($this->maxItems !== null && $this->minItems > $this->maxItems) { |
|
| 137 | throw new \SwaggerGen\Exception("Minimum greater than maximum: '{$data}'"); |
|
| 138 | } |
|
| 139 | return $this; |
|
| 140 | ||
| 141 | case 'max': |
|
| 142 | $this->maxItems = intval($data); |
|
| @@ 141-149 (lines=9) @@ | ||
| 138 | } |
|
| 139 | return $this; |
|
| 140 | ||
| 141 | case 'max': |
|
| 142 | $this->maxItems = intval($data); |
|
| 143 | if ($this->minItems !== null && $this->minItems > $this->maxItems) { |
|
| 144 | throw new \SwaggerGen\Exception("Maximum less than minimum: '{$data}'"); |
|
| 145 | } |
|
| 146 | if ($this->maxItems < 0) { |
|
| 147 | throw new \SwaggerGen\Exception("Maximum less than zero: '{$data}'"); |
|
| 148 | } |
|
| 149 | return $this; |
|
| 150 | ||
| 151 | case 'items': |
|
| 152 | $this->Items = $this->validateItems($data); |
|
| @@ 118-127 (lines=10) @@ | ||
| 115 | } |
|
| 116 | return $this; |
|
| 117 | ||
| 118 | case 'min': |
|
| 119 | $this->minProperties = intval($data); |
|
| 120 | if ($this->minProperties < 0) { |
|
| 121 | throw new \SwaggerGen\Exception("Minimum less than zero: '{$data}'"); |
|
| 122 | } |
|
| 123 | if ($this->maxProperties !== null && $this->minProperties > $this->maxProperties) { |
|
| 124 | throw new \SwaggerGen\Exception("Minimum greater than maximum: '{$data}'"); |
|
| 125 | } |
|
| 126 | $this->minProperties = intval($data); |
|
| 127 | return $this; |
|
| 128 | ||
| 129 | case 'max': |
|
| 130 | $this->maxProperties = intval($data); |
|
| @@ 129-137 (lines=9) @@ | ||
| 126 | $this->minProperties = intval($data); |
|
| 127 | return $this; |
|
| 128 | ||
| 129 | case 'max': |
|
| 130 | $this->maxProperties = intval($data); |
|
| 131 | if ($this->minProperties !== null && $this->minProperties > $this->maxProperties) { |
|
| 132 | throw new \SwaggerGen\Exception("Maximum less than minimum: '{$data}'"); |
|
| 133 | } |
|
| 134 | if ($this->maxProperties < 0) { |
|
| 135 | throw new \SwaggerGen\Exception("Maximum less than zero: '{$data}'"); |
|
| 136 | } |
|
| 137 | return $this; |
|
| 138 | } |
|
| 139 | ||
| 140 | return parent::handleCommand($command, $data); |
|