@@ -16,7 +16,7 @@ |
||
16 | 16 | { |
17 | 17 | public function register(Container $pimple) |
18 | 18 | { |
19 | - $pimple['http_client'] = function ($app) { |
|
19 | + $pimple['http_client'] = function($app) { |
|
20 | 20 | return new Client($app['config']->get('http', [])); |
21 | 21 | }; |
22 | 22 | } |
@@ -16,7 +16,7 @@ |
||
16 | 16 | { |
17 | 17 | public function register(Container $pimple) |
18 | 18 | { |
19 | - $pimple['logger'] = $pimple['log'] = function ($app) { |
|
19 | + $pimple['logger'] = $pimple['log'] = function($app) { |
|
20 | 20 | $config = $this->formatLogConfig($app); |
21 | 21 | |
22 | 22 | if (!empty($config)) { |
@@ -16,7 +16,7 @@ |
||
16 | 16 | { |
17 | 17 | public function register(Container $pimple) |
18 | 18 | { |
19 | - $pimple['config'] = function ($app) { |
|
19 | + $pimple['config'] = function($app) { |
|
20 | 20 | return new Config($app->getConfig()); |
21 | 21 | }; |
22 | 22 | } |
@@ -16,7 +16,7 @@ |
||
16 | 16 | { |
17 | 17 | public function register(Container $pimple) |
18 | 18 | { |
19 | - $pimple['extension'] = function ($app) { |
|
19 | + $pimple['extension'] = function($app) { |
|
20 | 20 | return new Extension($app); |
21 | 21 | }; |
22 | 22 | } |
@@ -16,7 +16,7 @@ |
||
16 | 16 | { |
17 | 17 | public function register(Container $pimple) |
18 | 18 | { |
19 | - $pimple['request'] = function () { |
|
19 | + $pimple['request'] = function() { |
|
20 | 20 | return Request::createFromGlobals(); |
21 | 21 | }; |
22 | 22 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | return $this->callCustomCreator($config); |
105 | 105 | } |
106 | 106 | |
107 | - $driverMethod = 'create' . ucfirst($config['driver']) . 'Driver'; |
|
107 | + $driverMethod = 'create'.ucfirst($config['driver']).'Driver'; |
|
108 | 108 | |
109 | 109 | if (method_exists($this, $driverMethod)) { |
110 | 110 | return $this->{$driverMethod}($config); |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | protected function createEmergencyLogger() |
121 | 121 | { |
122 | 122 | return new Monolog('AplisinDingTalk', $this->prepareHandlers([ |
123 | - new StreamHandler(\sys_get_temp_dir() . '/dingtalk/dingtalk.log', $this->level(['level' => 'debug'])) |
|
123 | + new StreamHandler(\sys_get_temp_dir().'/dingtalk/dingtalk.log', $this->level(['level' => 'debug'])) |
|
124 | 124 | ])); |
125 | 125 | } |
126 | 126 |
@@ -91,7 +91,7 @@ |
||
91 | 91 | |
92 | 92 | public static function flatten(array $array, $depth = INF) |
93 | 93 | { |
94 | - return array_reduce($array, function ($result, $item) use ($depth) { |
|
94 | + return array_reduce($array, function($result, $item) use ($depth) { |
|
95 | 95 | $item = $item instanceof Collection ? $item->all() : $item; |
96 | 96 | if (!is_array($item)) { |
97 | 97 | return array_merge($result, [$item]); |
@@ -15,7 +15,7 @@ |
||
15 | 15 | { |
16 | 16 | public function register(Container $app) |
17 | 17 | { |
18 | - isset($app['access_token']) || $app['access_token'] = function ($app) { |
|
18 | + isset($app['access_token']) || $app['access_token'] = function($app) { |
|
19 | 19 | return new AccessToken($app); |
20 | 20 | }; |
21 | 21 | } |
@@ -158,8 +158,8 @@ discard block |
||
158 | 158 | |
159 | 159 | protected function accessTokenMiddleware() |
160 | 160 | { |
161 | - return function (callable $handler) { |
|
162 | - return function (RequestInterface $request, array $options) use ($handler) { |
|
161 | + return function(callable $handler) { |
|
162 | + return function(RequestInterface $request, array $options) use ($handler) { |
|
163 | 163 | if ($this->accessToken) { |
164 | 164 | $request = $this->accessToken->applyToRequest($request, $options); |
165 | 165 | } |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | |
179 | 179 | protected function retryMiddleware() |
180 | 180 | { |
181 | - return Middleware::retry(function ( |
|
181 | + return Middleware::retry(function( |
|
182 | 182 | $retries, |
183 | 183 | RequestInterface $request, |
184 | 184 | ResponseInterface $response = null |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | } |
198 | 198 | |
199 | 199 | return false; |
200 | - }, function () { |
|
200 | + }, function() { |
|
201 | 201 | return abs($this->app->config->get('http.retry_delay', 500)); |
202 | 202 | }); |
203 | 203 | } |