@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | */ |
| 84 | 84 | public static function normalizeConnection(array $connection) |
| 85 | 85 | { |
| 86 | - $normal = [ ]; |
|
| 86 | + $normal = []; |
|
| 87 | 87 | |
| 88 | 88 | if (array_key_exists('options', $connection)) { |
| 89 | 89 | $normal['options'] = $connection['options']; |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | return static::normalizeHostString($host); |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | - return [ $host ]; |
|
| 120 | + return [$host]; |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | /** |
@@ -132,8 +132,8 @@ discard block |
||
| 132 | 132 | */ |
| 133 | 133 | protected static function normalizeHostArray(array $hostArray) |
| 134 | 134 | { |
| 135 | - if (! array_key_exists('host', $hostArray)) { |
|
| 136 | - return [ $hostArray ]; |
|
| 135 | + if (!array_key_exists('host', $hostArray)) { |
|
| 136 | + return [$hostArray]; |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | $port = Arr::get($hostArray, 'port', 26379); |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | */ |
| 156 | 156 | protected static function normalizeHostString($hostString, $port = 26379) |
| 157 | 157 | { |
| 158 | - $hosts = [ ]; |
|
| 158 | + $hosts = []; |
|
| 159 | 159 | |
| 160 | 160 | foreach (explode(',', $hostString) as $host) { |
| 161 | 161 | $host = trim($host); |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | if (Str::contains($host, ':')) { |
| 164 | 164 | $hosts[] = $host; |
| 165 | 165 | } else { |
| 166 | - $hosts[] = [ 'host' => $host, 'port' => $port ]; |
|
| 166 | + $hosts[] = ['host' => $host, 'port' => $port]; |
|
| 167 | 167 | } |
| 168 | 168 | } |
| 169 | 169 | |
@@ -129,7 +129,7 @@ |
||
| 129 | 129 | /** |
| 130 | 130 | * Create an instance of the loader and load the configuration in one step. |
| 131 | 131 | * |
| 132 | - * @param LaravelApplication|LumenApplication $app The current application |
|
| 132 | + * @param \Illuminate\Contracts\Foundation\Application $app The current application |
|
| 133 | 133 | * instance that provides context and services needed to load the |
| 134 | 134 | * appropriate configuration. |
| 135 | 135 | * |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | */ |
| 144 | 144 | public function loadConfiguration() |
| 145 | 145 | { |
| 146 | - if (! $this->shouldLoadConfiguration()) { |
|
| 146 | + if (!$this->shouldLoadConfiguration()) { |
|
| 147 | 147 | return; |
| 148 | 148 | } |
| 149 | 149 | |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | */ |
| 259 | 259 | protected function setSessionConfiguration() |
| 260 | 260 | { |
| 261 | - if (! $this->supportsSessions |
|
| 261 | + if (!$this->supportsSessions |
|
| 262 | 262 | || $this->config->get('session.driver') !== 'redis-sentinel' |
| 263 | 263 | || $this->config->get('session.connection') !== null |
| 264 | 264 | ) { |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | protected function mergePackageConfiguration() |
| 294 | 294 | { |
| 295 | 295 | $defaultConfig = require __DIR__ . '/../../config/redis-sentinel.php'; |
| 296 | - $currentConfig = $this->config->get('redis-sentinel', [ ]); |
|
| 296 | + $currentConfig = $this->config->get('redis-sentinel', []); |
|
| 297 | 297 | |
| 298 | 298 | $this->packageConfig = array_merge($defaultConfig, $currentConfig); |
| 299 | 299 | } |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | { |
| 309 | 309 | $connections = $this->config->get('database.redis-sentinel'); |
| 310 | 310 | |
| 311 | - if (! is_array($connections)) { |
|
| 311 | + if (!is_array($connections)) { |
|
| 312 | 312 | return; |
| 313 | 313 | } |
| 314 | 314 | |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | $this->config = ConfigurationLoader::load($this->app); |
| 59 | 59 | |
| 60 | 60 | $this->app->singleton('redis-sentinel', function ($app) { |
| 61 | - $config = $app->make('config')->get('database.redis-sentinel', [ ]); |
|
| 61 | + $config = $app->make('config')->get('database.redis-sentinel', []); |
|
| 62 | 62 | |
| 63 | 63 | return new RedisSentinelDatabase($config); |
| 64 | 64 | }); |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | // Lumen 5.2 and below don't provide a hook that initializes the |
| 143 | 143 | // broadcast component when attempting to resolve the BroadcastManager: |
| 144 | 144 | if ($this->config->isLumen |
| 145 | - && ! array_key_exists($broadcast, $this->app->availableBindings) |
|
| 145 | + && !array_key_exists($broadcast, $this->app->availableBindings) |
|
| 146 | 146 | ) { |
| 147 | 147 | $provider = 'Illuminate\Broadcasting\BroadcastServiceProvider'; |
| 148 | 148 | $this->app->register($provider); |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | * @param array $server The configuration options for the connection |
| 105 | 105 | * @param array $options The global options shared by all Sentinel clients |
| 106 | 106 | * |
| 107 | - * @return Client The Predis Client instance |
|
| 107 | + * @return PredisConnection The Predis Client instance |
|
| 108 | 108 | */ |
| 109 | 109 | protected function createSingleClient(array $server, array $options) |
| 110 | 110 | { |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | * Sets the Sentinel-specific connection options on a Predis Client |
| 134 | 134 | * connection |
| 135 | 135 | * |
| 136 | - * @param Client $client The Predis Client to set options for |
|
| 136 | + * @param PredisConnection $client The Predis Client to set options for |
|
| 137 | 137 | * @param array $sentinelOpts The options supported by Predis for |
| 138 | 138 | * Sentinel-specific connections |
| 139 | 139 | * |
@@ -146,7 +146,7 @@ |
||
| 146 | 146 | foreach ($sentinelOpts as $option => $value) { |
| 147 | 147 | DynamicMethod::parseFromUnderscore($option) |
| 148 | 148 | ->prepend('set') |
| 149 | - ->callOn($client, [ $value ]); |
|
| 149 | + ->callOn($client, [$value]); |
|
| 150 | 150 | } |
| 151 | 151 | } |
| 152 | 152 | } |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | $method = 'subscribe' |
| 127 | 127 | ) { |
| 128 | 128 | $this->retryOnFailure(function () use ($method, $channels, $callback) { |
| 129 | - $loop = $this->pubSubLoop([ $method => (array) $channels ]); |
|
| 129 | + $loop = $this->pubSubLoop([$method => (array) $channels]); |
|
| 130 | 130 | |
| 131 | 131 | if ($method === 'psubscribe') { |
| 132 | 132 | $messageKind = 'pmessage'; |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | */ |
| 202 | 202 | public function getClientFor($connectionID) |
| 203 | 203 | { |
| 204 | - if (! $connection = $this->getConnectionById($connectionID)) { |
|
| 204 | + if (!$connection = $this->getConnectionById($connectionID)) { |
|
| 205 | 205 | throw new InvalidArgumentException( |
| 206 | 206 | "Invalid connection ID: $connectionID." |
| 207 | 207 | ); |