@@ -38,17 +38,17 @@ |
||
| 38 | 38 | */ |
| 39 | 39 | public function handle() |
| 40 | 40 | { |
| 41 | - if (! $this->option('alone')) { |
|
| 41 | + if (!$this->option('alone')) { |
|
| 42 | 42 | $this->call('clear-compiled'); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | if ($this->laravel->bound('command.ide-helper.generate')) { |
| 46 | 46 | $this->call('ide-helper:generate'); |
| 47 | 47 | $this->call('ide-helper:meta'); |
| 48 | - $this->call('ide-helper:models', ['-R' => true, '-N' => true]); |
|
| 48 | + $this->call('ide-helper:models', [ '-R' => true, '-N' => true ]); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - if (! $this->option('alone')) { |
|
| 51 | + if (!$this->option('alone')) { |
|
| 52 | 52 | $this->call('optimize'); |
| 53 | 53 | } |
| 54 | 54 | } |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | |
| 38 | 38 | $this->setCharactersInEnvironmentFile($characters); |
| 39 | 39 | |
| 40 | - $this->laravel['config']['support.int2string'] = $characters; |
|
| 40 | + $this->laravel[ 'config' ][ 'support.int2string' ] = $characters; |
|
| 41 | 41 | |
| 42 | 42 | $this->info("Characters [<comment>$characters</comment>] set successfully."); |
| 43 | 43 | } |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace ElfSundae\Laravel\Support\Services\Optimus; |
| 4 | 4 | |
| 5 | -use Illuminate\Support\Str; |
|
| 6 | 5 | use Illuminate\Console\Command; |
| 7 | 6 | use Jenssegers\Optimus\Energon; |
| 8 | 7 | |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | */ |
| 31 | 31 | public function handle() |
| 32 | 32 | { |
| 33 | - $values = array_combine(['prime', 'inverse', 'random'], Energon::generate()); |
|
| 33 | + $values = array_combine([ 'prime', 'inverse', 'random' ], Energon::generate()); |
|
| 34 | 34 | |
| 35 | 35 | if ($this->option('show')) { |
| 36 | 36 | return $this->printValues($values); |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | $this->setValuesInEnvironmentFile($values); |
| 40 | 40 | |
| 41 | - $this->laravel['config']['support.optimus'] = $values; |
|
| 41 | + $this->laravel[ 'config' ][ 'support.optimus' ] = $values; |
|
| 42 | 42 | |
| 43 | 43 | $this->printValues($values); |
| 44 | 44 | |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | protected function printValues($values) |
| 54 | 54 | { |
| 55 | - $this->table(array_keys($values), [array_values($values)]); |
|
| 55 | + $this->table(array_keys($values), [ array_values($values) ]); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | /** |
@@ -623,7 +623,7 @@ |
||
| 623 | 623 | * Remove tags for the given device token. |
| 624 | 624 | * |
| 625 | 625 | * @param string $deviceToken |
| 626 | - * @param mixed $tags |
|
| 626 | + * @param string[] $tags |
|
| 627 | 627 | * @return bool |
| 628 | 628 | */ |
| 629 | 629 | public function removeTagsForDeviceToken($deviceToken, $tags) |
@@ -222,10 +222,10 @@ discard block |
||
| 222 | 222 | public function encodeCustomData($data) |
| 223 | 223 | { |
| 224 | 224 | if ($this->customKey && $data) { |
| 225 | - return [$this->customKey => $data]; |
|
| 225 | + return [ $this->customKey => $data ]; |
|
| 226 | 226 | } |
| 227 | 227 | |
| 228 | - return $data ?: []; |
|
| 228 | + return $data ?: [ ]; |
|
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | /** |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | if (is_object($user)) { |
| 244 | 244 | $user = $user->id; |
| 245 | 245 | } elseif (is_array($user)) { |
| 246 | - $user = $user['id']; |
|
| 246 | + $user = $user[ 'id' ]; |
|
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | return $this->accountPrefix.$user; |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | */ |
| 258 | 258 | public function accountsForUsers(array $users) |
| 259 | 259 | { |
| 260 | - return array_map([$this, 'accountForUser'], $users); |
|
| 260 | + return array_map([ $this, 'accountForUser' ], $users); |
|
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | /** |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | $accounts = $this->accountsForUsers($users); |
| 364 | 364 | |
| 365 | 365 | if (count($accounts) == 1) { |
| 366 | - return $this->xinge->PushSingleAccount(0, $accounts[0], $message, $this->environment); |
|
| 366 | + return $this->xinge->PushSingleAccount(0, $accounts[ 0 ], $message, $this->environment); |
|
| 367 | 367 | } |
| 368 | 368 | |
| 369 | 369 | return $this->xinge->PushAccountList(0, $accounts, $message, $this->environment); |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | { |
| 438 | 438 | $pushIds = $this->getParameterAsArray(func_get_args()); |
| 439 | 439 | |
| 440 | - $list = $this->result($this->xinge->QueryPushStatus($pushIds), 'list', []); |
|
| 440 | + $list = $this->result($this->xinge->QueryPushStatus($pushIds), 'list', [ ]); |
|
| 441 | 441 | |
| 442 | 442 | return array_combine(array_pluck($list, 'push_id'), $list); |
| 443 | 443 | } |
@@ -461,7 +461,7 @@ discard block |
||
| 461 | 461 | */ |
| 462 | 462 | public function queryDeviceTokensForUser($user) |
| 463 | 463 | { |
| 464 | - return $this->result($this->xinge->QueryTokensOfAccount($this->accountForUser($user)), 'tokens', []); |
|
| 464 | + return $this->result($this->xinge->QueryTokensOfAccount($this->accountForUser($user)), 'tokens', [ ]); |
|
| 465 | 465 | } |
| 466 | 466 | |
| 467 | 467 | /** |
@@ -540,7 +540,7 @@ discard block |
||
| 540 | 540 | */ |
| 541 | 541 | public function queryTagsForDeviceToken($deviceToken) |
| 542 | 542 | { |
| 543 | - return $this->result($this->xinge->QueryTokenTags($deviceToken), 'tags', []); |
|
| 543 | + return $this->result($this->xinge->QueryTokenTags($deviceToken), 'tags', [ ]); |
|
| 544 | 544 | } |
| 545 | 545 | |
| 546 | 546 | /** |
@@ -554,9 +554,9 @@ discard block |
||
| 554 | 554 | { |
| 555 | 555 | $deviceTokens = $this->queryDeviceTokensForUser($user); |
| 556 | 556 | |
| 557 | - $result = []; |
|
| 557 | + $result = [ ]; |
|
| 558 | 558 | foreach ($deviceTokens as $token) { |
| 559 | - $result[$token] = $this->queryTagsForDeviceToken($token); |
|
| 559 | + $result[ $token ] = $this->queryTagsForDeviceToken($token); |
|
| 560 | 560 | } |
| 561 | 561 | |
| 562 | 562 | return $result; |
@@ -687,8 +687,8 @@ discard block |
||
| 687 | 687 | $tags = $this->getParameterAsArray(func_get_args(), 1); |
| 688 | 688 | $oldTags = $this->queryTagsForUser($user, $tokens); |
| 689 | 689 | |
| 690 | - $addTagTokenPairs = []; |
|
| 691 | - $removeTagTokenPairs = []; |
|
| 690 | + $addTagTokenPairs = [ ]; |
|
| 691 | + $removeTagTokenPairs = [ ]; |
|
| 692 | 692 | |
| 693 | 693 | foreach ($oldTags as $token => $tokenTags) { |
| 694 | 694 | $addTagTokenPairs = array_merge($addTagTokenPairs, |
@@ -722,7 +722,7 @@ discard block |
||
| 722 | 722 | */ |
| 723 | 723 | protected function getParameterAsArray(array $args, $offset = 0) |
| 724 | 724 | { |
| 725 | - return is_array($args[$offset]) ? $args[$offset] : array_slice($args, $offset); |
|
| 725 | + return is_array($args[ $offset ]) ? $args[ $offset ] : array_slice($args, $offset); |
|
| 726 | 726 | } |
| 727 | 727 | |
| 728 | 728 | /** |
@@ -736,12 +736,12 @@ discard block |
||
| 736 | 736 | */ |
| 737 | 737 | protected function createTagTokenPairs($tags, $tokens) |
| 738 | 738 | { |
| 739 | - $tagTokenPairs = []; |
|
| 739 | + $tagTokenPairs = [ ]; |
|
| 740 | 740 | |
| 741 | 741 | $tokens = (array) $tokens; |
| 742 | 742 | foreach ((array) $tags as $tag) { |
| 743 | 743 | foreach ($tokens as $token) { |
| 744 | - $tagTokenPairs[] = new TagTokenPair($tag, $token); |
|
| 744 | + $tagTokenPairs[ ] = new TagTokenPair($tag, $token); |
|
| 745 | 745 | } |
| 746 | 746 | } |
| 747 | 747 | |
@@ -757,6 +757,6 @@ discard block |
||
| 757 | 757 | */ |
| 758 | 758 | public function __call($method, $parameters) |
| 759 | 759 | { |
| 760 | - return call_user_func_array([$this->xinge, $method], $parameters); |
|
| 760 | + return call_user_func_array([ $this->xinge, $method ], $parameters); |
|
| 761 | 761 | } |
| 762 | 762 | } |
@@ -19,15 +19,15 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | public function register() |
| 21 | 21 | { |
| 22 | - $this->app->singleton(Optimus::class, function ($app) { |
|
| 23 | - $config = $app['config']->get('support.optimus'); |
|
| 22 | + $this->app->singleton(Optimus::class, function($app) { |
|
| 23 | + $config = $app[ 'config' ]->get('support.optimus'); |
|
| 24 | 24 | |
| 25 | - return new Optimus($config['prime'], $config['inverse'], $config['random']); |
|
| 25 | + return new Optimus($config[ 'prime' ], $config[ 'inverse' ], $config[ 'random' ]); |
|
| 26 | 26 | }); |
| 27 | 27 | |
| 28 | 28 | $this->app->alias(Optimus::class, 'optimus'); |
| 29 | 29 | |
| 30 | - $this->app->singleton('command.optimus.generate', function () { |
|
| 30 | + $this->app->singleton('command.optimus.generate', function() { |
|
| 31 | 31 | return new GenerateOptimusCommand; |
| 32 | 32 | }); |
| 33 | 33 | |
@@ -18,13 +18,13 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | public function register() |
| 20 | 20 | { |
| 21 | - $this->app->singleton(XgPusher::class, function ($app) { |
|
| 22 | - $config = $app['config']['support.xgpush']; |
|
| 21 | + $this->app->singleton(XgPusher::class, function($app) { |
|
| 22 | + $config = $app[ 'config' ][ 'support.xgpush' ]; |
|
| 23 | 23 | |
| 24 | - return (new XgPusher($config['key'], $config['secret'])) |
|
| 25 | - ->setEnvironment($config['environment']) |
|
| 26 | - ->setCustomKey($config['custom_key']) |
|
| 27 | - ->setAccountPrefix($config['account_prefix']); |
|
| 24 | + return (new XgPusher($config[ 'key' ], $config[ 'secret' ])) |
|
| 25 | + ->setEnvironment($config[ 'environment' ]) |
|
| 26 | + ->setCustomKey($config[ 'custom_key' ]) |
|
| 27 | + ->setAccountPrefix($config[ 'account_prefix' ]); |
|
| 28 | 28 | }); |
| 29 | 29 | |
| 30 | 30 | $this->app->alias(XgPusher::class, 'xgpusher'); |
@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | use Ramsey\Uuid\Uuid; |
| 4 | 4 | |
| 5 | -if (! function_exists('get_id')) { |
|
| 5 | +if (!function_exists('get_id')) { |
|
| 6 | 6 | /** |
| 7 | 7 | * Get id from a mixed variable. |
| 8 | 8 | * |
@@ -15,14 +15,14 @@ discard block |
||
| 15 | 15 | if (is_object($var)) { |
| 16 | 16 | return $var->{$key}; |
| 17 | 17 | } elseif (is_array($var)) { |
| 18 | - return $var[$key]; |
|
| 18 | + return $var[ $key ]; |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | return $var; |
| 22 | 22 | } |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | -if (! function_exists('is_domain')) { |
|
| 25 | +if (!function_exists('is_domain')) { |
|
| 26 | 26 | /** |
| 27 | 27 | * Determines the current domain equals to the given domain identifier. |
| 28 | 28 | * |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | } |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | -if (! function_exists('app_url')) { |
|
| 38 | +if (!function_exists('app_url')) { |
|
| 39 | 39 | /** |
| 40 | 40 | * Generate an URL for the application. |
| 41 | 41 | * |
@@ -47,14 +47,14 @@ discard block |
||
| 47 | 47 | function app_url($path = '', $parameters = null, $identifier = 'site') |
| 48 | 48 | { |
| 49 | 49 | $path = trim($path, '/'); |
| 50 | - if (! empty($path) && ! starts_with($path, ['?', '&', '#'])) { |
|
| 50 | + if (!empty($path) && !starts_with($path, [ '?', '&', '#' ])) { |
|
| 51 | 51 | $path = '/'.$path; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - if (! is_null($parameters)) { |
|
| 54 | + if (!is_null($parameters)) { |
|
| 55 | 55 | $query = http_build_query($parameters); |
| 56 | - if (! empty($query)) { |
|
| 57 | - $path .= (str_contains($path, ['?', '&', '#']) ? '&' : '?').$query; |
|
| 56 | + if (!empty($query)) { |
|
| 57 | + $path .= (str_contains($path, [ '?', '&', '#' ]) ? '&' : '?').$query; |
|
| 58 | 58 | } |
| 59 | 59 | } |
| 60 | 60 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | } |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | -if (! function_exists('revision')) { |
|
| 69 | +if (!function_exists('revision')) { |
|
| 70 | 70 | /** |
| 71 | 71 | * Get the revisioned asset path. |
| 72 | 72 | * |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | } |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | -if (! function_exists('asset_from')) { |
|
| 86 | +if (!function_exists('asset_from')) { |
|
| 87 | 87 | /** |
| 88 | 88 | * Generate the URL to an asset from a custom root domain such as CDN, etc. |
| 89 | 89 | * |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | } |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | -if (! function_exists('asset_url')) { |
|
| 101 | +if (!function_exists('asset_url')) { |
|
| 102 | 102 | /** |
| 103 | 103 | * Generate an asset URL. |
| 104 | 104 | * |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | -if (! function_exists('cdn_url')) { |
|
| 118 | +if (!function_exists('cdn_url')) { |
|
| 119 | 119 | /** |
| 120 | 120 | * Generate an asset CDN URL. |
| 121 | 121 | * |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | } |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | -if (! function_exists('gravatar')) { |
|
| 131 | +if (!function_exists('gravatar')) { |
|
| 132 | 132 | /** |
| 133 | 133 | * Generate a Gravatar url. |
| 134 | 134 | * |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | } |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | -if (! function_exists('optimus_encode')) { |
|
| 161 | +if (!function_exists('optimus_encode')) { |
|
| 162 | 162 | /** |
| 163 | 163 | * Encode a number with Optimus. |
| 164 | 164 | * |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | } |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | -if (! function_exists('optimus_decode')) { |
|
| 174 | +if (!function_exists('optimus_decode')) { |
|
| 175 | 175 | /** |
| 176 | 176 | * Decode a number with Optimus. |
| 177 | 177 | * |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | } |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | -if (! function_exists('random_uuid')) { |
|
| 187 | +if (!function_exists('random_uuid')) { |
|
| 188 | 188 | /** |
| 189 | 189 | * Generate a version 4 (random) UUID. |
| 190 | 190 | * |