@@ -12,7 +12,7 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | public function register(Container $app) |
| 14 | 14 | { |
| 15 | - $app['page'] = function ($app) { |
|
| 15 | + $app['page'] = function($app) { |
|
| 16 | 16 | return new Client($app); |
| 17 | 17 | }; |
| 18 | 18 | } |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | public function register(Container $app) |
| 14 | 14 | { |
| 15 | - $app['adtag'] = function ($app) { |
|
| 15 | + $app['adtag'] = function($app) { |
|
| 16 | 16 | return new Client($app); |
| 17 | 17 | }; |
| 18 | 18 | } |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | public function register(Container $app) |
| 14 | 14 | { |
| 15 | - $app['device'] = function ($app) { |
|
| 15 | + $app['device'] = function($app) { |
|
| 16 | 16 | return new Client($app); |
| 17 | 17 | }; |
| 18 | 18 | } |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | $array = json_decode($this->getBodyContents(), true); |
| 57 | 57 | |
| 58 | 58 | if (JSON_ERROR_NONE === json_last_error()) { |
| 59 | - return (array) $array; |
|
| 59 | + return (array)$array; |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | return []; |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | return $this->callCustomCreator($config); |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | - $driverMethod = 'create'.ucfirst($config['driver']).'Driver'; |
|
| 144 | + $driverMethod = 'create' . ucfirst($config['driver']) . 'Driver'; |
|
| 145 | 145 | |
| 146 | 146 | if (method_exists($this, $driverMethod)) { |
| 147 | 147 | return $this->{$driverMethod}($config); |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | protected function createEmergencyLogger() |
| 159 | 159 | { |
| 160 | 160 | return new Monolog('Midas', $this->prepareHandlers([new StreamHandler( |
| 161 | - \sys_get_temp_dir().'/midas/midas.log', $this->level(['level' => 'debug']) |
|
| 161 | + \sys_get_temp_dir() . '/midas/midas.log', $this->level(['level' => 'debug']) |
|
| 162 | 162 | )])); |
| 163 | 163 | } |
| 164 | 164 | |
@@ -11,9 +11,9 @@ |
||
| 11 | 11 | |
| 12 | 12 | class ServiceContainer extends Container |
| 13 | 13 | { |
| 14 | - /** |
|
| 15 | - * @var array |
|
| 16 | - */ |
|
| 14 | + /** |
|
| 15 | + * @var array |
|
| 16 | + */ |
|
| 17 | 17 | protected $providers = []; |
| 18 | 18 | |
| 19 | 19 | /** |
@@ -28,8 +28,7 @@ |
||
| 28 | 28 | $response->getBody()->rewind(); |
| 29 | 29 | |
| 30 | 30 | switch ($type ?: 'array') { |
| 31 | - case 'collection': |
|
| 32 | - return $response->toCollection(); |
|
| 31 | + case 'collection' : return $response->toCollection(); |
|
| 33 | 32 | case 'array': |
| 34 | 33 | return $response->toArray(); |
| 35 | 34 | case 'object': |
@@ -79,9 +79,9 @@ discard block |
||
| 79 | 79 | |
| 80 | 80 | foreach ($array as $key => $value) { |
| 81 | 81 | if (is_array($value) && !empty($value)) { |
| 82 | - $results = array_merge($results, static::dot($value, $prepend.$key.'.')); |
|
| 82 | + $results = array_merge($results, static::dot($value, $prepend . $key . '.')); |
|
| 83 | 83 | } else { |
| 84 | - $results[$prepend.$key] = $value; |
|
| 84 | + $results[$prepend . $key] = $value; |
|
| 85 | 85 | } |
| 86 | 86 | } |
| 87 | 87 | |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | */ |
| 175 | 175 | public static function flatten(array $array, $depth = INF) |
| 176 | 176 | { |
| 177 | - return array_reduce($array, function ($result, $item) use ($depth) { |
|
| 177 | + return array_reduce($array, function($result, $item) use ($depth) { |
|
| 178 | 178 | $item = $item instanceof Collection ? $item->all() : $item; |
| 179 | 179 | |
| 180 | 180 | if (!is_array($item)) { |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | { |
| 198 | 198 | $original = &$array; |
| 199 | 199 | |
| 200 | - $keys = (array) $keys; |
|
| 200 | + $keys = (array)$keys; |
|
| 201 | 201 | |
| 202 | 202 | if (0 === count($keys)) { |
| 203 | 203 | return; |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | return false; |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | - $keys = (array) $keys; |
|
| 277 | + $keys = (array)$keys; |
|
| 278 | 278 | |
| 279 | 279 | if (empty($array)) { |
| 280 | 280 | return false; |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | */ |
| 330 | 330 | public static function only(array $array, $keys) |
| 331 | 331 | { |
| 332 | - return array_intersect_key($array, array_flip((array) $keys)); |
|
| 332 | + return array_intersect_key($array, array_flip((array)$keys)); |
|
| 333 | 333 | } |
| 334 | 334 | |
| 335 | 335 | /** |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | |
| 391 | 391 | $results = []; |
| 392 | 392 | |
| 393 | - foreach ((array) $keys as $key) { |
|
| 393 | + foreach ((array)$keys as $key) { |
|
| 394 | 394 | $results[] = $array[$key]; |
| 395 | 395 | } |
| 396 | 396 | |
@@ -149,14 +149,14 @@ |
||
| 149 | 149 | */ |
| 150 | 150 | public static function snake($value, $delimiter = '_') |
| 151 | 151 | { |
| 152 | - $key = $value.$delimiter; |
|
| 152 | + $key = $value . $delimiter; |
|
| 153 | 153 | |
| 154 | 154 | if (isset(static::$snakeCache[$key])) { |
| 155 | 155 | return static::$snakeCache[$key]; |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | if (!ctype_lower($value)) { |
| 159 | - $value = strtolower(preg_replace('/(.)(?=[A-Z])/', '$1'.$delimiter, $value)); |
|
| 159 | + $value = strtolower(preg_replace('/(.)(?=[A-Z])/', '$1' . $delimiter, $value)); |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | return static::$snakeCache[$key] = trim($value, '_'); |