Completed
Push — master ( b8ee44...86e435 )
by Jim
02:27
created
tests/TimCloudTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
tests/Foundation/Log/LogManagerTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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());
Please login to merge, or discard this patch.
src/Foundation/ServiceProviders/LogServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
                     ],
Please login to merge, or discard this patch.
src/Foundation/ServiceProviders/ConfigServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Foundation/Log/LogManager.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         ]);
Please login to merge, or discard this patch.
tests/bootstrap.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
src/Core/IMCloud.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     /**
Please login to merge, or discard this patch.
src/Support/Str.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
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));
Please login to merge, or discard this patch.
src/Core/ServiceProviders/ApiAliasServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
      */
25 25
     public function register(Container $pimple)
26 26
     {
27
-        $pimple['apiAlias'] = function ($pimple) {
27
+        $pimple['apiAlias'] = function($pimple) {
28 28
             return new ApiAlias();
29 29
         };
30 30
     }
Please login to merge, or discard this patch.