Passed
Push — 0.7.0 ( 8dcee5...2ee31f )
by Alexander
02:31
created
src/components/Support/Chronos/Traits/Difference.php 1 patch
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -228,34 +228,28 @@
 block discarded – undo
228 228
         {
229 229
             $phrase = __('time.years', [abs($years)], $locale);
230 230
             $before = $years < 0;
231
-        }
232
-        else if ($months !== 0)
231
+        } else if ($months !== 0)
233 232
         {
234 233
             $phrase = __('time.months', [abs($months)], $locale);
235 234
             $before = $months < 0;
236
-        }
237
-        else if ($days !== 0 && (abs($days) >= 7))
235
+        } else if ($days !== 0 && (abs($days) >= 7))
238 236
         {
239 237
             $weeks  = ceil($days / 7);
240 238
             $phrase = __('time.weeks', [abs($weeks)], $locale);
241 239
             $before = $days < 0;
242
-        }
243
-        else if ($days !== 0)
240
+        } else if ($days !== 0)
244 241
         {
245 242
             $phrase = __('time.days', [abs($days)], $locale);
246 243
             $before = $days < 0;
247
-        }
248
-        else if ($hours !== 0)
244
+        } else if ($hours !== 0)
249 245
         {
250 246
             $phrase = __('time.hours', [abs($hours)], $locale);
251 247
             $before = $hours < 0;
252
-        }
253
-        else if ($minutes !== 0)
248
+        } else if ($minutes !== 0)
254 249
         {
255 250
             $phrase = __('time.minutes', [abs($minutes)], $locale);
256 251
             $before = $minutes < 0;
257
-        }
258
-        else
252
+        } else
259 253
         {
260 254
             return __('time.now', [], $locale);
261 255
         }
Please login to merge, or discard this patch.
src/components/Support/Chronos/Traits/Schedule.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -167,7 +167,7 @@
 block discarded – undo
167 167
         {
168 168
             if ($transition['time'] > $this->format('U'))
169 169
             {
170
-               $dayLightSaving = (bool) $transition['isdst'] ?? $dayLightSaving;
170
+                $dayLightSaving = (bool) $transition['isdst'] ?? $dayLightSaving;
171 171
             }
172 172
         }
173 173
 
Please login to merge, or discard this patch.
src/components/Support/Chronos/Traits/Date.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -52,10 +52,10 @@  discard block
 block discarded – undo
52 52
     use Difference;
53 53
 
54 54
     /**
55
-	 * Used to check time string to determine if it is relative time or not.
56
-	 *
57
-	 * @var string $relativePattern
58
-	 */
55
+     * Used to check time string to determine if it is relative time or not.
56
+     *
57
+     * @var string $relativePattern
58
+     */
59 59
     protected static $relativePattern = '/this|next|last|tomorrow|yesterday|midnight|today|[+-]|first|last|ago/i';
60 60
 
61 61
     /**
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 
119 119
     /**
120 120
      * Returns boolean whether the passed timezone is the same as
121
-	 * the local timezone.
121
+     * the local timezone.
122 122
      * 
123 123
      * @return bool
124 124
      */
@@ -219,13 +219,13 @@  discard block
 block discarded – undo
219 219
         return $this->toLocalizedFormatter('yyyy-MM-dd');
220 220
     }
221 221
 
222
-     /**
223
-     * Returns a localized version of the time in nicer date format.
224
-     * 
225
-     * i.e. 10:20:33
226
-     * 
227
-     * @return string
228
-     */
222
+        /**
223
+         * Returns a localized version of the time in nicer date format.
224
+         * 
225
+         * i.e. 10:20:33
226
+         * 
227
+         * @return string
228
+         */
229 229
     public function toTimeString()
230 230
     {
231 231
         return $this->toLocalizedFormatter('HH:mm:ss');
Please login to merge, or discard this patch.
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -274,19 +274,16 @@  discard block
 block discarded – undo
274 274
         {
275 275
             $phrase = __('time.years', [abs($years)]);
276 276
             $before = $years < 0;
277
-        }
278
-        elseif ($months !== 0)
277
+        } elseif ($months !== 0)
279 278
         {
280 279
             $phrase = __('time.months', [abs($months)]);
281 280
             $before = $months < 0;
282
-        }
283
-        elseif ($days !== 0 && (abs($days) >= 7))
281
+        } elseif ($days !== 0 && (abs($days) >= 7))
284 282
         {
285 283
             $weeks  = ceil($days / 7);
286 284
             $phrase = __('time.weeks', [abs($weeks)]);
287 285
             $before = $days < 0;
288
-        }
289
-        elseif ($days !== 0)
286
+        } elseif ($days !== 0)
290 287
         {
291 288
             $before = $days < 0;
292 289
             $phrase = __('time.days', [abs($days)]);
@@ -295,23 +292,19 @@  discard block
 block discarded – undo
295 292
             if (abs($days) === 1)
296 293
             {
297 294
                 return $before ? __('time.yesterday') : __('time.tomorrow');
298
-            }
299
-            else
295
+            } else
300 296
             {
301 297
                 $phrase = __('time.days', [abs($days) + 1]);
302 298
             }
303
-        }
304
-        elseif ($hours !== 0)
299
+        } elseif ($hours !== 0)
305 300
         {
306 301
             // Display the actual time instead of a regular phrase.
307 302
             return $this->format('g:i a');
308
-        }
309
-        elseif ($minutes !== 0)
303
+        } elseif ($minutes !== 0)
310 304
         {
311 305
             $phrase = __('time.minutes', [abs($minutes)]);
312 306
             $before = $minutes < 0;
313
-        }
314
-        else
307
+        } else
315 308
         {
316 309
             return __('time.now');
317 310
         }
Please login to merge, or discard this patch.
src/components/Support/Str.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -206,7 +206,9 @@
 block discarded – undo
206 206
      */
207 207
     public static function limit($value, $limit, $end = '...')
208 208
     {
209
-        if (static::length($value) <= $limit) return $value;
209
+        if (static::length($value) <= $limit) {
210
+            return $value;
211
+        }
210 212
 
211 213
         return rtrim(mb_substr($value, 0, $limit, 'UTF-8')).$end;
212 214
     }
Please login to merge, or discard this patch.
src/components/Support/helpers.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 
177 177
 if ( ! function_exists('str_underscore'))
178 178
 {
179
-  /**
179
+    /**
180 180
      * Replace in the string the spaces by low dashes.
181 181
      *
182 182
      * @param  string  $string
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 
194 194
 if ( ! function_exists('studly_caps'))
195 195
 {
196
-  /**
196
+    /**
197 197
      * Convert the string with spaces or underscore in StudlyCaps. 
198 198
      *
199 199
      * @param  string  $string
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
      */
70 70
     function dd()
71 71
     {
72
-        array_map(function ($x)
72
+        array_map(function($x)
73 73
         {
74 74
             var_dump($x);
75 75
         },  func_get_args());
Please login to merge, or discard this patch.
src/components/Support/Manager.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -122,8 +122,7 @@
 block discarded – undo
122 122
         if (isset($this->customCreators[$driver]))
123 123
         {
124 124
             return $this->callCustomCreator($driver);
125
-        }
126
-        else
125
+        } else
127 126
         {
128 127
             $method = 'create'.Str::studlycaps($driver).'Driver';
129 128
 
Please login to merge, or discard this patch.
src/components/Support/Finder.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -133,12 +133,10 @@  discard block
 block discarded – undo
133 133
             if ($pos === null)
134 134
             {
135 135
                 $this->paths[] = $this->prepPath($path);
136
-            }
137
-            elseif ($pos === -1)
136
+            } elseif ($pos === -1)
138 137
             {
139 138
                 array_unshift($this->paths, $this->prepPath($path));
140
-            }
141
-            else
139
+            } else
142 140
             {
143 141
                 if ($pos > count($this->paths))
144 142
                 {
@@ -170,12 +168,10 @@  discard block
 block discarded – undo
170 168
         if (is_null($extension))
171 169
         {
172 170
             $extension = '.php';
173
-        }
174
-        elseif (isset($extension))
171
+        } elseif (isset($extension))
175 172
         {
176 173
             $extension = ".{$extension}";
177
-        }
178
-        else
174
+        } else
179 175
         {
180 176
             $extension = '';
181 177
         }
@@ -183,8 +179,7 @@  discard block
 block discarded – undo
183 179
         if ( ! empty($file) || ! is_null($file)) 
184 180
         {
185 181
             $file = str_replace(['::', '.'], DIRECTORY_SEPARATOR, $file);
186
-        }
187
-        else 
182
+        } else 
188 183
         {
189 184
             $file = $file ?: 'empty';
190 185
 
Please login to merge, or discard this patch.
src/components/Support/Flowing.php 1 patch
Indentation   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -173,53 +173,53 @@
 block discarded – undo
173 173
     }
174 174
 
175 175
     /**
176
-	 * Magic method. Searches for the given variable and returns its value.
177
-	 *
178
-	 * @param  string  $key  Variable name
179
-	 *
180
-	 * @return mixed
181
-	 */
182
-	public function __get($key) 
183
-	{
184
-		return $this->get($key);
185
-	}
186
-
187
-	/**
188
-	 * Magic method. Calls [$this->set] with the same parameters.
189
-	 *
190
-	 * @param  string  $key    Variable name
191
-	 * @param  mixed   $value  Value
192
-	 *
193
-	 * @return void
194
-	 */
195
-	public function __set($key, $value) 
196
-	{
197
-		$this->offsetSet($key, $value);
198
-	}
199
-
200
-	/**
201
-	 * Magic method. Determines if a variable is set.
202
-	 *
203
-	 * @param  string  $key  variable name
204
-	 *
205
-	 * @return boolean
206
-	 */
207
-	public function __isset($key) 
208
-	{
209
-		return $this->offsetExists($key);
210
-	}
211
-
212
-	/**
213
-	 * Magic method. Unsets a given variable.
214
-	 *
215
-	 * @param  string  $key  Variable name
216
-	 *
217
-	 * @return void
218
-	 */
219
-	public function __unset($key) 
220
-	{
221
-		$this->offsetUnset($$key);
222
-	}
176
+     * Magic method. Searches for the given variable and returns its value.
177
+     *
178
+     * @param  string  $key  Variable name
179
+     *
180
+     * @return mixed
181
+     */
182
+    public function __get($key) 
183
+    {
184
+        return $this->get($key);
185
+    }
186
+
187
+    /**
188
+     * Magic method. Calls [$this->set] with the same parameters.
189
+     *
190
+     * @param  string  $key    Variable name
191
+     * @param  mixed   $value  Value
192
+     *
193
+     * @return void
194
+     */
195
+    public function __set($key, $value) 
196
+    {
197
+        $this->offsetSet($key, $value);
198
+    }
199
+
200
+    /**
201
+     * Magic method. Determines if a variable is set.
202
+     *
203
+     * @param  string  $key  variable name
204
+     *
205
+     * @return boolean
206
+     */
207
+    public function __isset($key) 
208
+    {
209
+        return $this->offsetExists($key);
210
+    }
211
+
212
+    /**
213
+     * Magic method. Unsets a given variable.
214
+     *
215
+     * @param  string  $key  Variable name
216
+     *
217
+     * @return void
218
+     */
219
+    public function __unset($key) 
220
+    {
221
+        $this->offsetUnset($$key);
222
+    }
223 223
 
224 224
     /**
225 225
      * Handle dynamic calls to the container to set attributes.
Please login to merge, or discard this patch.
src/components/Container/Container.php 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -257,9 +257,9 @@  discard block
 block discarded – undo
257 257
     {
258 258
         if ( ! empty($this->buildStack))
259 259
         {
260
-           $reset   = implode(', ', $this->buildStack);
260
+            $reset   = implode(', ', $this->buildStack);
261 261
 
262
-           $message = "Target [ {$class} ] is not instantiable while building [ {$reset} ]."; 
262
+            $message = "Target [ {$class} ] is not instantiable while building [ {$reset} ]."; 
263 263
         } 
264 264
         else
265 265
         {
@@ -717,7 +717,7 @@  discard block
 block discarded – undo
717 717
 
718 718
         array_pop($this->across);
719 719
 
720
-       return $this->resolveObject($id, $object);
720
+        return $this->resolveObject($id, $object);
721 721
     }
722 722
 
723 723
     /**
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
      */
190 190
     protected function getClosure($id, string $value)
191 191
     {
192
-        return function ($container, $parameters = []) use ($id, $value) 
192
+        return function($container, $parameters = []) use ($id, $value) 
193 193
         {
194 194
             if ($id == $value)
195 195
             {
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
      */
449 449
     public function factory($id)
450 450
     {
451
-        return function () use ($id) {
451
+        return function() use ($id) {
452 452
             return $this->make($id);
453 453
         };
454 454
     }
@@ -855,7 +855,7 @@  discard block
 block discarded – undo
855 855
      */
856 856
     public function bound($id)
857 857
     {
858
-        return isset($this->bindings[$id])  ||
858
+        return isset($this->bindings[$id]) ||
859 859
                isset($this->instances[$id]) ||
860 860
                $this->isAlias($id);
861 861
     }
Please login to merge, or discard this patch.
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -260,8 +260,7 @@  discard block
 block discarded – undo
260 260
            $reset   = implode(', ', $this->buildStack);
261 261
 
262 262
            $message = "Target [ {$class} ] is not instantiable while building [ {$reset} ]."; 
263
-        } 
264
-        else
263
+        } else
265 264
         {
266 265
             $message = "Target [ {$class} ] is not instantiable.";
267 266
         }
@@ -345,8 +344,7 @@  discard block
 block discarded – undo
345 344
         try 
346 345
         {
347 346
             return $this->make($parameter->getClass()->name);
348
-        }
349
-        catch (BindingResolutionException $e) 
347
+        } catch (BindingResolutionException $e) 
350 348
         {
351 349
             if ($parameter->isOptional()) 
352 350
             {
@@ -400,8 +398,7 @@  discard block
 block discarded – undo
400 398
             $this->instances[$id] = $closure($this->instances[$id], $this);
401 399
 
402 400
             $this->reHas($id);
403
-        }
404
-        else
401
+        } else
405 402
         {
406 403
             $this->services[$id][] = $closure;
407 404
             
@@ -702,8 +699,7 @@  discard block
 block discarded – undo
702 699
         if ($this->isBuildable($value, $id))
703 700
         {
704 701
             $object = $this->build($value);
705
-        }
706
-        else
702
+        } else
707 703
         {
708 704
             $object = $this->make($value);
709 705
         }
@@ -822,8 +818,7 @@  discard block
 block discarded – undo
822 818
         try 
823 819
         {
824 820
             return $this->resolve($id);
825
-        }
826
-        catch (Exception $e)
821
+        } catch (Exception $e)
827 822
         {
828 823
             if ( ! $this->has($id))
829 824
             {
Please login to merge, or discard this patch.