@@ -46,12 +46,10 @@ |
||
46 | 46 | ) |
47 | 47 | { |
48 | 48 | return true; |
49 | - } |
|
50 | - elseif ($parent instanceof ScalarType) |
|
49 | + } elseif ($parent instanceof ScalarType) |
|
51 | 50 | { |
52 | 51 | return get_class($parent) === get_class($child); |
53 | - } |
|
54 | - elseif ($parent instanceof ObjectType) |
|
52 | + } elseif ($parent instanceof ObjectType) |
|
55 | 53 | { |
56 | 54 | if |
57 | 55 | ( |
@@ -87,15 +87,13 @@ discard block |
||
87 | 87 | if ($building) |
88 | 88 | { |
89 | 89 | $this->buildProperty($property); |
90 | - } |
|
91 | - else |
|
90 | + } else |
|
92 | 91 | { |
93 | 92 | if (isset($args[$i])) |
94 | 93 | { |
95 | 94 | $this->setAnyValue($property, $args[$i]); |
96 | 95 | $i++; |
97 | - } |
|
98 | - else |
|
96 | + } else |
|
99 | 97 | { |
100 | 98 | $building = true; |
101 | 99 | $this->buildProperty($property); |
@@ -119,8 +117,7 @@ discard block |
||
119 | 117 | if (!$property->type instanceof ObjectType) |
120 | 118 | { |
121 | 119 | $this->setAnyValue($property, 0); |
122 | - } |
|
123 | - elseif ($property->builtInConstructor) |
|
120 | + } elseif ($property->builtInConstructor) |
|
124 | 121 | { |
125 | 122 | $class = (string)$property->type->classname; |
126 | 123 | $this->setRawValue($property->name, new $class()); |
@@ -175,12 +172,10 @@ discard block |
||
175 | 172 | if ($comparator->compatible($property->type, $valueType)) |
176 | 173 | { |
177 | 174 | $this->setRawValue($property->name, $value); |
178 | - } |
|
179 | - elseif ($property->type instanceof ScalarType) |
|
175 | + } elseif ($property->type instanceof ScalarType) |
|
180 | 176 | { |
181 | 177 | $this->setScalarValue($property, $valueType, $value); |
182 | - } |
|
183 | - else |
|
178 | + } else |
|
184 | 179 | { |
185 | 180 | $this->throwError($property, $valueType); |
186 | 181 | } |
@@ -209,8 +204,7 @@ discard block |
||
209 | 204 | $property->name, |
210 | 205 | $property->type->cast($value) |
211 | 206 | ); |
212 | - } |
|
213 | - elseif (is_object($value) && method_exists([$value, $method])) |
|
207 | + } elseif (is_object($value) && method_exists([$value, $method])) |
|
214 | 208 | { |
215 | 209 | $this->setScalarValue |
216 | 210 | ( |
@@ -218,8 +212,7 @@ discard block |
||
218 | 212 | $valueType, |
219 | 213 | $value->$method() |
220 | 214 | ); |
221 | - } |
|
222 | - else |
|
215 | + } else |
|
223 | 216 | { |
224 | 217 | $this->throwError($property, $valueType); |
225 | 218 | } |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $i = 0; |
83 | 83 | |
84 | 84 | $code = |
85 | - 'namespace ' . $class->namespace . ';' |
|
85 | + 'namespace ' . $class->namespace . ';' |
|
86 | 86 | . 'class ' . $class->classname . ' ' |
87 | 87 | . 'extends \\' . $originalClass |
88 | 88 | . '{'; |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | } |
119 | 119 | |
120 | 120 | return |
121 | - ($method->scope === 'static' ? 'static ' : '') |
|
121 | + ($method->scope === 'static' ? 'static ' : '') |
|
122 | 122 | . 'function ' . $method->name |
123 | 123 | . '(' . implode(',', $params) . '){' |
124 | 124 | . '__generic_' . $method->name |
@@ -62,7 +62,7 @@ |
||
62 | 62 | public function __toString() |
63 | 63 | { |
64 | 64 | return |
65 | - ($this->namespace ? $this->namespace . '\\' : '') |
|
65 | + ($this->namespace ? $this->namespace . '\\' : '') |
|
66 | 66 | . $this->classname; |
67 | 67 | } |
68 | 68 |