@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | */ |
26 | 26 | public function register(Container $pimple) |
27 | 27 | { |
28 | - $pimple['logger'] = $pimple['log'] = function ($app) { |
|
28 | + $pimple['logger'] = $pimple['log'] = function($app) { |
|
29 | 29 | $config = $this->formatLogConfig($app); |
30 | 30 | |
31 | 31 | if (!empty($config)) { |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | 'channels' => [ |
78 | 78 | 'single' => [ |
79 | 79 | 'driver' => 'single', |
80 | - 'path' => $app['config']->get('log.file') ?: \sys_get_temp_dir() . '/logs/tim-sdk.log', |
|
80 | + 'path' => $app['config']->get('log.file') ?: \sys_get_temp_dir().'/logs/tim-sdk.log', |
|
81 | 81 | 'level' => $app['config']->get('log.level', 'debug'), |
82 | 82 | ], |
83 | 83 | ], |
@@ -23,7 +23,7 @@ |
||
23 | 23 | */ |
24 | 24 | public function register(Container $pimple) |
25 | 25 | { |
26 | - $pimple['config'] = $pimple[Config::class] = function ($app) { |
|
26 | + $pimple['config'] = $pimple[Config::class] = function($app) { |
|
27 | 27 | return new Config($app->getConfig()); |
28 | 28 | }; |
29 | 29 | } |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | if (isset($this->customCreators[$config['driver']])) { |
143 | 143 | return $this->callCustomCreator($config); |
144 | 144 | } |
145 | - $driverMethod = 'create' . ucfirst($config['driver']) . 'Driver'; |
|
145 | + $driverMethod = 'create'.ucfirst($config['driver']).'Driver'; |
|
146 | 146 | if (method_exists($this, $driverMethod)) { |
147 | 147 | return $this->{$driverMethod}($config); |
148 | 148 | } |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | { |
159 | 159 | return new Monolog('TimSDK', $this->prepareHandlers([ |
160 | 160 | new StreamHandler( |
161 | - \sys_get_temp_dir() . '/tim-sdk/tim-sdk.log', $this->level(['level' => 'debug']) |
|
161 | + \sys_get_temp_dir().'/tim-sdk/tim-sdk.log', $this->level(['level' => 'debug']) |
|
162 | 162 | ), |
163 | 163 | ])); |
164 | 164 | } |
@@ -237,11 +237,11 @@ discard block |
||
237 | 237 | $this->prepareHandler(new SlackWebhookHandler( |
238 | 238 | $config['url'], |
239 | 239 | Arr::get($config, 'channel', null), |
240 | - Arr::get($config ,'username', 'TimSDK'), |
|
241 | - Arr::get($config ,'attachment', true), |
|
242 | - Arr::get($config ,'emoji', ':boom:'), |
|
243 | - Arr::get($config ,'short', false), |
|
244 | - Arr::get($config ,'context', true), |
|
240 | + Arr::get($config, 'username', 'TimSDK'), |
|
241 | + Arr::get($config, 'attachment', true), |
|
242 | + Arr::get($config, 'emoji', ':boom:'), |
|
243 | + Arr::get($config, 'short', false), |
|
244 | + Arr::get($config, 'context', true), |
|
245 | 245 | $this->level($config) |
246 | 246 | )), |
247 | 247 | ]); |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | define('TEST_ROOT', __DIR__); |
4 | -define('PROJECT_ROOT', rtrim(dirname(__DIR__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'src'); |
|
4 | +define('PROJECT_ROOT', rtrim(dirname(__DIR__), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.'src'); |
|
5 | 5 | |
6 | -require __DIR__ . '/../vendor/autoload.php'; |
|
6 | +require __DIR__.'/../vendor/autoload.php'; |
|
7 | 7 | |
8 | 8 | function phpunit_env($name, $default = null) |
9 | 9 | { |
10 | - $value = \TimSDK\Support\Arr::get(get_defined_constants(true), 'user.' . strtoupper($name), $default); |
|
10 | + $value = \TimSDK\Support\Arr::get(get_defined_constants(true), 'user.'.strtoupper($name), $default); |
|
11 | 11 | |
12 | 12 | return $value !== '0' && empty($value) ? $default : $value; |
13 | 13 | } |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | { |
147 | 147 | $this->initializeQuery(); |
148 | 148 | |
149 | - Log::debug('Is need refresh: ' . ($this->needRefresh ? 'true' : 'false')); |
|
149 | + Log::debug('Is need refresh: '.($this->needRefresh ? 'true' : 'false')); |
|
150 | 150 | |
151 | 151 | if ($this->needRefresh) { |
152 | 152 | $this->needRefresh = false; |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | */ |
171 | 171 | protected function getFullApiUrl($uri) |
172 | 172 | { |
173 | - return Str::startsWith($uri, ['http', 'https']) ? $uri : API::BASE_URL . $uri; |
|
173 | + return Str::startsWith($uri, ['http', 'https']) ? $uri : API::BASE_URL.$uri; |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | /** |
@@ -66,7 +66,7 @@ |
||
66 | 66 | return static::$snakeCache[$key][$delimiter]; |
67 | 67 | } |
68 | 68 | |
69 | - if (! ctype_lower($value)) { |
|
69 | + if (!ctype_lower($value)) { |
|
70 | 70 | $value = preg_replace('/\s+/u', '', ucwords($value)); |
71 | 71 | |
72 | 72 | $value = static::lower(preg_replace('/(.)(?=[A-Z])/u', '$1'.$delimiter, $value)); |
@@ -24,7 +24,7 @@ |
||
24 | 24 | */ |
25 | 25 | public function register(Container $pimple) |
26 | 26 | { |
27 | - $pimple['apiAlias'] = function () { |
|
27 | + $pimple['apiAlias'] = function() { |
|
28 | 28 | return new ApiAlias(); |
29 | 29 | }; |
30 | 30 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | { |
33 | 33 | $t = $this->timCloud(); |
34 | 34 | |
35 | - $this->assertTrue(file_exists($t['path.cert'] . '/cacert.pem')); |
|
35 | + $this->assertTrue(file_exists($t['path.cert'].'/cacert.pem')); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | public function testFormatKey() |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | public function testRequestApiSuccess() |
186 | 186 | { |
187 | 187 | $t = $this->timCloud(); |
188 | - $t->offsetSet('im', function () { |
|
188 | + $t->offsetSet('im', function() { |
|
189 | 189 | $m = Mockery::mock('im'); |
190 | 190 | $m->shouldReceive('handle')->withAnyArgs()->andReturn(new ResponseBag([ |
191 | 191 | 'ActionStatus' => 'OK', |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | public function testRequestApiError() |
213 | 213 | { |
214 | 214 | $t = $this->timCloud([ |
215 | - 'im' => function () { |
|
215 | + 'im' => function() { |
|
216 | 216 | $m = Mockery::mock(IMCloud::class); |
217 | 217 | $return = new ResponseBag([ |
218 | 218 | 'ErrorCode' => 80002, |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | 'cli_on' => false |
254 | 254 | ] |
255 | 255 | ], array_merge([ |
256 | - 'TLSSig' => function () { |
|
256 | + 'TLSSig' => function() { |
|
257 | 257 | $m = Mockery::mock('TLSSig'); |
258 | 258 | $m->shouldReceive('genSig')->withAnyArgs()->andReturn('test usersig'); |
259 | 259 | return $m; |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $app = new ServiceContainer(); |
74 | 74 | |
75 | 75 | $this->assertSame(PROJECT_ROOT, $app->basePath()); |
76 | - $this->assertSame(PROJECT_ROOT . DIRECTORY_SEPARATOR . 'Cert', $app->basePath('Cert')); |
|
76 | + $this->assertSame(PROJECT_ROOT.DIRECTORY_SEPARATOR.'Cert', $app->basePath('Cert')); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | /** |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | { |
100 | 100 | public function register(Container $pimple) |
101 | 101 | { |
102 | - $pimple['foo'] = function () { |
|
102 | + $pimple['foo'] = function() { |
|
103 | 103 | return 'foo'; |
104 | 104 | }; |
105 | 105 | } |