@@ -48,10 +48,10 @@ discard block |
||
48 | 48 | */ |
49 | 49 | private $description; |
50 | 50 | |
51 | - /** |
|
52 | - * Whether property is read only |
|
53 | - * @var bool |
|
54 | - */ |
|
51 | + /** |
|
52 | + * Whether property is read only |
|
53 | + * @var bool |
|
54 | + */ |
|
55 | 55 | private $readOnly; |
56 | 56 | |
57 | 57 | /** |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | * @param \SwaggerGen\Swagger\AbstractObject $parent |
66 | 66 | * @param string $definition Either a built-in type or a definition name |
67 | 67 | * @param string $description description of the property |
68 | - * @param bool $readOnly Whether the property is read only |
|
68 | + * @param bool $readOnly Whether the property is read only |
|
69 | 69 | * @throws \SwaggerGen\Exception |
70 | 70 | */ |
71 | 71 | public function __construct(\SwaggerGen\Swagger\AbstractObject $parent, $definition, $description = null, $readOnly = null) |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | { |
110 | 110 | return self::arrayFilterNull(array_merge($this->Type->toArray(), array( |
111 | 111 | 'description' => empty($this->description) ? null : $this->description, |
112 | - 'readOnly' => $this->readOnly |
|
112 | + 'readOnly' => $this->readOnly |
|
113 | 113 | ), parent::toArray())); |
114 | 114 | } |
115 | 115 |
@@ -142,13 +142,13 @@ |
||
142 | 142 | return $this; |
143 | 143 | |
144 | 144 | case 'model': |
145 | - case 'model!': |
|
145 | + case 'model!': |
|
146 | 146 | case 'definition': |
147 | - case 'definition!': |
|
147 | + case 'definition!': |
|
148 | 148 | $definition = new Schema($this); |
149 | 149 | if(substr($command, -1) === '!') { |
150 | - $definition->setReadOnly(); |
|
151 | - } |
|
150 | + $definition->setReadOnly(); |
|
151 | + } |
|
152 | 152 | $name = self::wordShift($data); |
153 | 153 | if (empty($name)) { |
154 | 154 | throw new \SwaggerGen\Exception('Missing definition name'); |
@@ -51,10 +51,10 @@ discard block |
||
51 | 51 | */ |
52 | 52 | private $title = null; |
53 | 53 | |
54 | - /** |
|
55 | - * @var bool |
|
56 | - */ |
|
57 | - private $readOnly = null; |
|
54 | + /** |
|
55 | + * @var bool |
|
56 | + */ |
|
57 | + private $readOnly = null; |
|
58 | 58 | |
59 | 59 | /** |
60 | 60 | * @var \SwaggerGen\Swagger\Type\AbstractType |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | return self::arrayFilterNull(array_merge($this->type->toArray(), array( |
119 | 119 | 'title' => empty($this->title) ? null : $this->title, |
120 | 120 | 'description' => empty($this->description) ? null : $this->description, |
121 | - 'readOnly' => $this->readOnly |
|
121 | + 'readOnly' => $this->readOnly |
|
122 | 122 | ), parent::toArray())); |
123 | 123 | } |
124 | 124 | |
@@ -127,9 +127,9 @@ discard block |
||
127 | 127 | return __CLASS__; |
128 | 128 | } |
129 | 129 | |
130 | - public function setReadOnly() |
|
131 | - { |
|
132 | - $this->readOnly = true; |
|
133 | - } |
|
130 | + public function setReadOnly() |
|
131 | + { |
|
132 | + $this->readOnly = true; |
|
133 | + } |
|
134 | 134 | |
135 | 135 | } |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | if (preg_match(self::REGEX_PROP_START . self::REGEX_PROP_NAME . self::REGEX_PROP_REQUIRED . self::REGEX_PROP_ASSIGN . self::REGEX_PROP_DEFINITION . self::REGEX_PROP_END, $property, $prop_match) !== 1) { |
64 | 64 | throw new \SwaggerGen\Exception("Unparseable property definition: '{$property}'"); |
65 | 65 | } |
66 | - $this->properties[$prop_match[1]] = new Property($this, $prop_match[3]); |
|
67 | - if ($prop_match[2] !== '!' && $prop_match[2] !== '?') { |
|
66 | + $this->properties[$prop_match[1]] = new Property($this, $prop_match[3]); |
|
67 | + if ($prop_match[2] !== '!' && $prop_match[2] !== '?') { |
|
68 | 68 | $this->required[$prop_match[1]] = true; |
69 | 69 | } |
70 | 70 | } |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | // type name description... |
104 | 104 | case 'property': |
105 | 105 | case 'property?': |
106 | - case 'property!': |
|
106 | + case 'property!': |
|
107 | 107 | $definition = self::wordShift($data); |
108 | 108 | if (empty($definition)) { |
109 | 109 | throw new \SwaggerGen\Exception("Missing property definition"); |
@@ -114,18 +114,18 @@ discard block |
||
114 | 114 | throw new \SwaggerGen\Exception("Missing property name: '{$definition}'"); |
115 | 115 | } |
116 | 116 | |
117 | - unset($this->required[$name]); |
|
117 | + unset($this->required[$name]); |
|
118 | 118 | $readOnly = null; |
119 | - $propertySuffix = substr($command, -1); |
|
120 | - if ($propertySuffix === '!') { |
|
121 | - $readOnly = true; |
|
122 | - } |
|
119 | + $propertySuffix = substr($command, -1); |
|
120 | + if ($propertySuffix === '!') { |
|
121 | + $readOnly = true; |
|
122 | + } |
|
123 | 123 | else if ($propertySuffix !== '?') { |
124 | 124 | $this->required[$name] = true; |
125 | 125 | } |
126 | 126 | |
127 | 127 | $this->mostRecentProperty = new Property($this, $definition, $data, $readOnly); |
128 | - $this->properties[$name] = $this->mostRecentProperty; |
|
128 | + $this->properties[$name] = $this->mostRecentProperty; |
|
129 | 129 | return $this; |
130 | 130 | |
131 | 131 | case 'min': |