@@ -2,14 +2,14 @@ |
||
| 2 | 2 | |
| 3 | 3 | define('TEST_ROOT', __DIR__); |
| 4 | 4 | |
| 5 | -require __DIR__ . '/../vendor/autoload.php'; |
|
| 5 | +require __DIR__.'/../vendor/autoload.php'; |
|
| 6 | 6 | |
| 7 | 7 | function phpunit_env($name, $default = null) |
| 8 | 8 | { |
| 9 | - return \TimSDK\Support\Arr::get(get_defined_constants(true), 'user.' . strtoupper($name), $default); |
|
| 9 | + return \TimSDK\Support\Arr::get(get_defined_constants(true), 'user.'.strtoupper($name), $default); |
|
| 10 | 10 | } |
| 11 | 11 | |
| 12 | -if (! function_exists('dd')) { |
|
| 12 | +if (!function_exists('dd')) { |
|
| 13 | 13 | function dd() |
| 14 | 14 | { |
| 15 | 15 | var_dump(func_get_args()); |
@@ -89,7 +89,7 @@ |
||
| 89 | 89 | $array = ['products' => ['desk' => ['price' => 100]]]; |
| 90 | 90 | $value = Arr::get($array, 'products.desk'); |
| 91 | 91 | $this->assertEquals(['price' => 100], $value); |
| 92 | - $this->assertEquals('test', Arr::get($array, 'foo.bar', function () { |
|
| 92 | + $this->assertEquals('test', Arr::get($array, 'foo.bar', function() { |
|
| 93 | 93 | return 'test'; |
| 94 | 94 | })); |
| 95 | 95 | } |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | public function testValue() |
| 18 | 18 | { |
| 19 | 19 | $this->assertEquals('foo', timsdk_value('foo')); |
| 20 | - $this->assertEquals('foo', timsdk_value(function () { |
|
| 20 | + $this->assertEquals('foo', timsdk_value(function() { |
|
| 21 | 21 | return 'foo'; |
| 22 | 22 | })); |
| 23 | 23 | } |
@@ -22,14 +22,14 @@ discard block |
||
| 22 | 22 | $app = new Application([ |
| 23 | 23 | 'foo' => 'bar', |
| 24 | 24 | ], [ |
| 25 | - 'bar' => function () { |
|
| 25 | + 'bar' => function() { |
|
| 26 | 26 | return new \stdClass(); |
| 27 | 27 | }, |
| 28 | 28 | 'name' => 'TimSDK', |
| 29 | 29 | 'foo' => 'Jim' |
| 30 | 30 | ]); |
| 31 | 31 | |
| 32 | - $app['foo'] = function () { |
|
| 32 | + $app['foo'] = function() { |
|
| 33 | 33 | return 'bar'; |
| 34 | 34 | }; |
| 35 | 35 | |
@@ -85,11 +85,11 @@ discard block |
||
| 85 | 85 | { |
| 86 | 86 | public function register(Container $pimple) |
| 87 | 87 | { |
| 88 | - $pimple['bar'] = function () { |
|
| 88 | + $pimple['bar'] = function() { |
|
| 89 | 89 | return 'foo'; |
| 90 | 90 | }; |
| 91 | 91 | |
| 92 | - $pimple['foo'] = function () { |
|
| 92 | + $pimple['foo'] = function() { |
|
| 93 | 93 | return new \stdClass(); |
| 94 | 94 | }; |
| 95 | 95 | } |
@@ -88,9 +88,9 @@ discard block |
||
| 88 | 88 | return $key; |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - return "-----BEGIN $keyType KEY-----" . PHP_EOL . |
|
| 92 | - wordwrap(str_replace(["\r", "\n"], '', $key), 64, PHP_EOL, true) . |
|
| 93 | - PHP_EOL . "-----END $keyType KEY-----"; |
|
| 91 | + return "-----BEGIN $keyType KEY-----".PHP_EOL. |
|
| 92 | + wordwrap(str_replace(["\r", "\n"], '', $key), 64, PHP_EOL, true). |
|
| 93 | + PHP_EOL."-----END $keyType KEY-----"; |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | /** |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | protected function setConfig($key, $value) |
| 110 | 110 | { |
| 111 | - if (! empty($value)) { |
|
| 111 | + if (!empty($value)) { |
|
| 112 | 112 | $oldVal = $this['config']->get($key, null); |
| 113 | 113 | if ($value !== $oldVal) { |
| 114 | 114 | $this['config']->set($key, $value); |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | foreach (['sdkappid', 'identifier', 'prikey', 'pubkey'] as $item) { |
| 168 | 168 | if (!isset($data[$item])) { |
| 169 | 169 | Log::debug('IMCloud Query: ', $data); |
| 170 | - throw new MissingArgumentsException('Missing ' . $item); |
|
| 170 | + throw new MissingArgumentsException('Missing '.$item); |
|
| 171 | 171 | } |
| 172 | 172 | } |
| 173 | 173 | |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | */ |
| 185 | 185 | protected function getFullApiUrl($uri) |
| 186 | 186 | { |
| 187 | - return Str::startsWith($uri, ['http', 'https']) ? $uri : API::BASE_URL . $uri; |
|
| 187 | + return Str::startsWith($uri, ['http', 'https']) ? $uri : API::BASE_URL.$uri; |
|
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | /** |
@@ -25,11 +25,11 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | public function register(Container $pimple) |
| 27 | 27 | { |
| 28 | - $pimple[IMCloud::class] = $pimple['im'] = function ($app) { |
|
| 28 | + $pimple[IMCloud::class] = $pimple['im'] = function($app) { |
|
| 29 | 29 | return new IMCloud($app); |
| 30 | 30 | }; |
| 31 | 31 | |
| 32 | - $pimple[TLSSig::class] = $pimple['TLSSig'] = function ($app) { |
|
| 32 | + $pimple[TLSSig::class] = $pimple['TLSSig'] = function($app) { |
|
| 33 | 33 | $api = new TLSSig(); |
| 34 | 34 | $api->setAppid($app['config']->get('sdkappid')); |
| 35 | 35 | $api->setPrivateKey($app['config']->get('prikey')); |
@@ -110,7 +110,7 @@ |
||
| 110 | 110 | $content = ''; |
| 111 | 111 | foreach ($members as $member) { |
| 112 | 112 | if (!isset($json[$member])) { |
| 113 | - throw new OpensslException('json need ' . $member); |
|
| 113 | + throw new OpensslException('json need '.$member); |
|
| 114 | 114 | } |
| 115 | 115 | $content .= "{$member}:{$json[$member]}\n"; |
| 116 | 116 | } |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | { |
| 25 | 25 | private function __construct() |
| 26 | 26 | { |
| 27 | - throw new NotInstantiableException(__CLASS__ . ' can not instantiate.'); |
|
| 27 | + throw new NotInstantiableException(__CLASS__.' can not instantiate.'); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | /** |