@@ -120,7 +120,7 @@ |
||
| 120 | 120 | */ |
| 121 | 121 | public function getDefaultAddress() |
| 122 | 122 | { |
| 123 | - return $this->selectAddresses(function (Address $address) { |
|
| 123 | + return $this->selectAddresses(function(Address $address) { |
|
| 124 | 124 | return $address->isDefault(); |
| 125 | 125 | })[0] ?? null; |
| 126 | 126 | } |
@@ -74,11 +74,11 @@ discard block |
||
| 74 | 74 | public function __call(string $method, array $args) |
| 75 | 75 | { |
| 76 | 76 | static $magic = []; |
| 77 | - if (!$call =& $magic[$method]) { |
|
| 77 | + if (!$call = & $magic[$method]) { |
|
| 78 | 78 | preg_match('/^([a-z]+)(.+)$/', $method, $call); |
| 79 | 79 | $call[1] = '_' . $call[1]; |
| 80 | 80 | if ($call[1] !== '_select') { // _select() calls getters |
| 81 | - $call[2] = preg_replace_callback('/[A-Z]/', function (array $match) { |
|
| 81 | + $call[2] = preg_replace_callback('/[A-Z]/', function(array $match) { |
|
| 82 | 82 | return '_' . lcfirst($match[0]); |
| 83 | 83 | }, lcfirst($call[2])); |
| 84 | 84 | } |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | if (is_string($item)) { // convert ids to lazy stubs |
| 104 | 104 | $item = ['id' => $item]; |
| 105 | 105 | } |
| 106 | - return $this->pool->get($item['id'], $this, function () use ($class, $item) { |
|
| 106 | + return $this->pool->get($item['id'], $this, function() use ($class, $item) { |
|
| 107 | 107 | return $this->api->factory($this, $class, $item); |
| 108 | 108 | }); |
| 109 | 109 | } |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | if (isset(static::MAP[$field])) { |
| 167 | 167 | $class = static::MAP[$field]; |
| 168 | 168 | if (is_array($class)) { |
| 169 | - $value = array_map(function ($each) use ($class) { |
|
| 169 | + $value = array_map(function($each) use ($class) { |
|
| 170 | 170 | return $this->_hydrate($class[0], $each); |
| 171 | 171 | }, $value); |
| 172 | 172 | } elseif (isset($value)) { |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | */ |
| 194 | 194 | public function toArray(): array |
| 195 | 195 | { |
| 196 | - return array_map(function ($value) { |
|
| 196 | + return array_map(function($value) { |
|
| 197 | 197 | if ($value instanceof self) { |
| 198 | 198 | return $value->toArray(); |
| 199 | 199 | } |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | */ |
| 153 | 153 | public function factoryAll($caller, string $class, array $list) |
| 154 | 154 | { |
| 155 | - return array_map(function (array $each) use ($caller, $class) { |
|
| 155 | + return array_map(function(array $each) use ($caller, $class) { |
|
| 156 | 156 | return $this->factory($caller, $class, $each); |
| 157 | 157 | }, $list); |
| 158 | 158 | } |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | */ |
| 222 | 222 | public function load($caller, string $class, string $path, array $query = []) |
| 223 | 223 | { |
| 224 | - return $this->pool->get($path, $caller, function ($caller) use ($class, $path, $query) { |
|
| 224 | + return $this->pool->get($path, $caller, function($caller) use ($class, $path, $query) { |
|
| 225 | 225 | if ($remote = $this->get($path, $query)) { |
| 226 | 226 | return $this->factory($caller, $class, $remote[$class::TYPE]); |
| 227 | 227 | } |
@@ -238,8 +238,8 @@ discard block |
||
| 238 | 238 | */ |
| 239 | 239 | public function loadAll($caller, string $class, string $path, array $query = []) |
| 240 | 240 | { |
| 241 | - return array_map(function (array $each) use ($caller, $class) { |
|
| 242 | - return $this->pool->get($each['id'], $caller, function ($caller) use ($class, $each) { |
|
| 241 | + return array_map(function(array $each) use ($caller, $class) { |
|
| 242 | + return $this->pool->get($each['id'], $caller, function($caller) use ($class, $each) { |
|
| 243 | 243 | return $this->factory($caller, $class, $each); |
| 244 | 244 | }); |
| 245 | 245 | }, $this->get($path, $query)[$class::DIR] ?? []); |