@@ -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', |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | public function testRequestApiError() |
| 208 | 208 | { |
| 209 | 209 | $t = $this->timCloud([ |
| 210 | - 'im' => function () { |
|
| 210 | + 'im' => function() { |
|
| 211 | 211 | $m = Mockery::mock(IMCloud::class); |
| 212 | 212 | $return = new ResponseBag([ |
| 213 | 213 | 'ErrorCode' => 80002, |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | 'private_key' => phpunit_env('private_key', 'openssl_private_key'), |
| 237 | 237 | 'public_key' => phpunit_env('public_key', 'openssl_public_key'), |
| 238 | 238 | ], array_merge([ |
| 239 | - 'TLSSig' => function () { |
|
| 239 | + 'TLSSig' => function() { |
|
| 240 | 240 | $m = Mockery::mock('TLSSig'); |
| 241 | 241 | $m->shouldReceive('genSig')->withAnyArgs()->andReturn('test usersig'); |
| 242 | 242 | return $m; |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | ], |
| 35 | 35 | 'single' => [ |
| 36 | 36 | 'driver' => 'single', |
| 37 | - 'path' => __DIR__ . '/logs/tim-sdk.log', |
|
| 37 | + 'path' => __DIR__.'/logs/tim-sdk.log', |
|
| 38 | 38 | 'level' => 'debug', |
| 39 | 39 | ], |
| 40 | 40 | ], |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | $emergencyLogger = \Mockery::mock(Logger::class); |
| 57 | 57 | $log->shouldReceive('createEmergencyLogger')->andReturn($emergencyLogger)->once(); |
| 58 | 58 | $emergencyLogger->shouldReceive('emergency') |
| 59 | - ->with('Unable to create configured logger. Using emergency logger.', \Mockery::on(function ($data) { |
|
| 59 | + ->with('Unable to create configured logger. Using emergency logger.', \Mockery::on(function($data) { |
|
| 60 | 60 | $this->assertArrayHasKey('exception', $data); |
| 61 | 61 | $this->assertInstanceOf(\InvalidArgumentException::class, $data['exception']); |
| 62 | 62 | $this->assertSame('Log [bad-name] is not defined.', $data['exception']->getMessage()); |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | ]); |
| 84 | 84 | |
| 85 | 85 | $log = new LogManager($app); |
| 86 | - $log->extend('mylog', function () { |
|
| 86 | + $log->extend('mylog', function() { |
|
| 87 | 87 | return 'mylog'; |
| 88 | 88 | }); |
| 89 | 89 | |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | $emergencyLogger = \Mockery::mock(Logger::class); |
| 111 | 111 | $log->shouldReceive('createEmergencyLogger')->andReturn($emergencyLogger)->once(); |
| 112 | 112 | $emergencyLogger->shouldReceive('emergency') |
| 113 | - ->with('Unable to create configured logger. Using emergency logger.', \Mockery::on(function ($data) { |
|
| 113 | + ->with('Unable to create configured logger. Using emergency logger.', \Mockery::on(function($data) { |
|
| 114 | 114 | $this->assertArrayHasKey('exception', $data); |
| 115 | 115 | $this->assertInstanceOf(\InvalidArgumentException::class, $data['exception']); |
| 116 | 116 | $this->assertSame('Driver [abcde] is not supported.', $data['exception']->getMessage()); |
@@ -166,7 +166,7 @@ |
||
| 166 | 166 | */ |
| 167 | 167 | protected function getFullApiUrl($uri) |
| 168 | 168 | { |
| 169 | - return Str::startsWith($uri, ['http', 'https']) ? $uri : API::BASE_URL . $uri; |
|
| 169 | + return Str::startsWith($uri, ['http', 'https']) ? $uri : API::BASE_URL.$uri; |
|
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | /** |
@@ -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 | } |