@@ -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 | |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | if (is_array($extraData)) { |
| 119 | 119 | return $this->mergeWith(new self($extraData)); |
| 120 | 120 | } elseif ($extraData instanceof self) { |
| 121 | - foreach($extraData as $key => $value) { |
|
| 121 | + foreach ($extraData as $key => $value) { |
|
| 122 | 122 | if (isset($this[$key]) |
| 123 | 123 | && $value instanceof self |
| 124 | 124 | && $this[$key] instanceof self |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | |
| 145 | 145 | public function __clone() |
| 146 | 146 | { |
| 147 | - foreach($this->data as $key => $value) { |
|
| 147 | + foreach ($this->data as $key => $value) { |
|
| 148 | 148 | if ($value instanceof self) { |
| 149 | 149 | $this->data[$key] = clone self; |
| 150 | 150 | } |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | |
| 154 | 154 | public function asArray() { |
| 155 | 155 | $result = $this->data; |
| 156 | - foreach($result as $key => $value) { |
|
| 156 | + foreach ($result as $key => $value) { |
|
| 157 | 157 | if ($value instanceof self) { |
| 158 | 158 | $result[$value] = $value->asArray(); |
| 159 | 159 | } |