@@ -110,8 +110,7 @@ |
||
| 110 | 110 | $prop->setAccessible(true); |
| 111 | 111 | |
| 112 | 112 | return $prop; |
| 113 | - } |
|
| 114 | - catch (ReflectionException $e) |
|
| 113 | + } catch (ReflectionException $e) |
|
| 115 | 114 | { |
| 116 | 115 | throw new $class |
| 117 | 116 | ( |
@@ -93,8 +93,7 @@ discard block |
||
| 93 | 93 | { |
| 94 | 94 | $as .= $token[1]; |
| 95 | 95 | } |
| 96 | - } |
|
| 97 | - elseif ($matching) |
|
| 96 | + } elseif ($matching) |
|
| 98 | 97 | { |
| 99 | 98 | switch ($token[0]) |
| 100 | 99 | { |
@@ -105,8 +104,7 @@ discard block |
||
| 105 | 104 | case T_AS: |
| 106 | 105 | $matching = T_AS; |
| 107 | 106 | } |
| 108 | - } |
|
| 109 | - else |
|
| 107 | + } else |
|
| 110 | 108 | { |
| 111 | 109 | switch ($token[0]) |
| 112 | 110 | { |
@@ -12,8 +12,7 @@ discard block |
||
| 12 | 12 | if ($property->writable) |
| 13 | 13 | { |
| 14 | 14 | parent::setAnyValue($property, $value); |
| 15 | - } |
|
| 16 | - else |
|
| 15 | + } else |
|
| 17 | 16 | { |
| 18 | 17 | throw new PropertyNotWritableException |
| 19 | 18 | ( |
@@ -32,8 +31,7 @@ discard block |
||
| 32 | 31 | get_class($this->object), |
| 33 | 32 | $property |
| 34 | 33 | ); |
| 35 | - } |
|
| 36 | - elseif (!$this->reflect->properties[$property]->readable) |
|
| 34 | + } elseif (!$this->reflect->properties[$property]->readable) |
|
| 37 | 35 | { |
| 38 | 36 | throw new PropertyNotReadableException |
| 39 | 37 | ( |
@@ -46,8 +46,7 @@ |
||
| 46 | 46 | if (!$matches) |
| 47 | 47 | { |
| 48 | 48 | $this->classname = $classname; |
| 49 | - } |
|
| 50 | - else |
|
| 49 | + } else |
|
| 51 | 50 | { |
| 52 | 51 | $this->classname = $matches[2]; |
| 53 | 52 | $this->namespace = $matches[1]; |
@@ -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 | } |
@@ -29,8 +29,7 @@ |
||
| 29 | 29 | if ($offset === null) |
| 30 | 30 | { |
| 31 | 31 | $this->add($value); |
| 32 | - } |
|
| 33 | - else |
|
| 32 | + } else |
|
| 34 | 33 | { |
| 35 | 34 | $this->set($offset, $value); |
| 36 | 35 | } |
@@ -51,12 +51,10 @@ discard block |
||
| 51 | 51 | if (is_array($iterator)) |
| 52 | 52 | { |
| 53 | 53 | $this->iterator = new ArrayIterator($iterator); |
| 54 | - } |
|
| 55 | - elseif ($iterator instanceof Iterator) |
|
| 54 | + } elseif ($iterator instanceof Iterator) |
|
| 56 | 55 | { |
| 57 | 56 | $this->iterator = $iterator; |
| 58 | - } |
|
| 59 | - elseif ($iterator instanceof IteratorAggregate) |
|
| 57 | + } elseif ($iterator instanceof IteratorAggregate) |
|
| 60 | 58 | { |
| 61 | 59 | while (true) |
| 62 | 60 | { |
@@ -66,12 +64,10 @@ discard block |
||
| 66 | 64 | { |
| 67 | 65 | $this->iterator = $newIterator; |
| 68 | 66 | break; |
| 69 | - } |
|
| 70 | - elseif ($newIterator instanceof IteratorAggregate) |
|
| 67 | + } elseif ($newIterator instanceof IteratorAggregate) |
|
| 71 | 68 | { |
| 72 | 69 | $iterator = $newIterator; |
| 73 | - } |
|
| 74 | - else |
|
| 70 | + } else |
|
| 75 | 71 | { |
| 76 | 72 | throw new DomainException |
| 77 | 73 | ( |
@@ -81,8 +77,7 @@ discard block |
||
| 81 | 77 | ); |
| 82 | 78 | } |
| 83 | 79 | } |
| 84 | - } |
|
| 85 | - else |
|
| 80 | + } else |
|
| 86 | 81 | { |
| 87 | 82 | throw new DomainException('Unknown type of iterator'); |
| 88 | 83 | } |
@@ -139,12 +139,10 @@ discard block |
||
| 139 | 139 | if ($i + 1 === strlen($value)) |
| 140 | 140 | { |
| 141 | 141 | throw new \Exception('Unexpected EOF'); |
| 142 | - } |
|
| 143 | - elseif ($value{$i + 1} !== ']') |
|
| 142 | + } elseif ($value{$i + 1} !== ']') |
|
| 144 | 143 | { |
| 145 | 144 | throw new \Exception('[ must be followed by ]'); |
| 146 | - } |
|
| 147 | - elseif ($i + 2 !== strlen($value)) |
|
| 145 | + } elseif ($i + 2 !== strlen($value)) |
|
| 148 | 146 | { |
| 149 | 147 | if (!in_array($value{$i + 2}, ['>',','])) |
| 150 | 148 | { |
@@ -240,8 +238,7 @@ discard block |
||
| 240 | 238 | if ($useStatements->containsKey($this->currentValue)) |
| 241 | 239 | { |
| 242 | 240 | return $useStatements[$this->currentValue]->classname; |
| 243 | - } |
|
| 244 | - else |
|
| 241 | + } else |
|
| 245 | 242 | { |
| 246 | 243 | return $this->context->namespace->namespace |
| 247 | 244 | . '\\' . $this->currentValue; |