Completed
Push — 1.x ( d54394...964a06 )
by Cy
01:54
created
src/Configuration/HostNormalizer.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Configuration/Loader.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@
 block discarded – undo
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
      *
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/RedisSentinelServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/RedisSentinelDatabase.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
      *
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
src/PredisConnection.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
             );
Please login to merge, or discard this patch.