@@ -30,8 +30,8 @@ discard block |
||
| 30 | 30 | */ |
| 31 | 31 | protected function createMaps() |
| 32 | 32 | { |
| 33 | - foreach($this->jsonAttributes as $attribute) { |
|
| 34 | - if(!$this->owner->$attribute instanceof Map) { |
|
| 33 | + foreach ($this->jsonAttributes as $attribute) { |
|
| 34 | + if (!$this->owner->$attribute instanceof Map) { |
|
| 35 | 35 | $this->owner->$attribute = new Map($this->owner->$attribute); |
| 36 | 36 | } |
| 37 | 37 | } |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | public function init() |
| 108 | 108 | { |
| 109 | 109 | parent::init(); |
| 110 | - if(!isset($this->defaultAttribute) && count($this->jsonAttributes) == 1) { |
|
| 110 | + if (!isset($this->defaultAttribute) && count($this->jsonAttributes) == 1) { |
|
| 111 | 111 | $this->defaultAttribute = $this->jsonAttributes[0]; |
| 112 | 112 | } |
| 113 | 113 | } |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | $this->data = $data; |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - if(!is_array($this->data)) { |
|
| 23 | + if (!is_array($this->data)) { |
|
| 24 | 24 | throw new \DomainException('Data must be array or json encoded array'); |
| 25 | 25 | } |
| 26 | 26 | |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | if ($extraData instanceof self) { |
| 108 | - foreach($extraData as $key => $value) { |
|
| 108 | + foreach ($extraData as $key => $value) { |
|
| 109 | 109 | if (isset($this[$key]) |
| 110 | 110 | && $value instanceof self |
| 111 | 111 | && $this[$key] instanceof self |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | public function __clone() |
| 134 | 134 | { |
| 135 | - foreach($this->data as $key => $value) { |
|
| 135 | + foreach ($this->data as $key => $value) { |
|
| 136 | 136 | if ($value instanceof self) { |
| 137 | 137 | $this->data[$key] = clone $value; |
| 138 | 138 | } |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | |
| 142 | 142 | public function asArray() { |
| 143 | 143 | $result = $this->data; |
| 144 | - foreach($result as $key => $value) { |
|
| 144 | + foreach ($result as $key => $value) { |
|
| 145 | 145 | if ($value instanceof self) { |
| 146 | 146 | $result[$key] = $value->asArray(); |
| 147 | 147 | } |