Passed
Push — master ( 88e104...0cbceb )
by Keoghan
01:25
created
src/TransformerServiceProvider.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
      */
35 35
     public function checkForCollectionExtensions()
36 36
     {
37
-        if (! Arr::hasMacro('fromDot') || ! Collection::hasMacro('fromDot')) {
37
+        if (!Arr::hasMacro('fromDot') || !Collection::hasMacro('fromDot')) {
38 38
             throw new \ErrorException(
39 39
                 'Please register the CollectionsServiceProvider from the laravel-extend-collections package. ' .
40 40
                 'Transformer requires the fromDot method for Illuminate Support Arr and Collection.'
@@ -47,15 +47,15 @@  discard block
 block discarded – undo
47 47
      */
48 48
     public function registerTransformer()
49 49
     {
50
-        $this->app->singleton(Transformer::class, function () {
50
+        $this->app->singleton(Transformer::class, function() {
51 51
             return new Transformer(config('transformer.rule_packs', []));
52 52
         });
53 53
     }
54 54
 
55 55
     public function registerRequestTransformMacro()
56 56
     {
57
-        if (! Request::hasMacro('transform')) {
58
-            Request::macro('transform', function ($rules = []) {
57
+        if (!Request::hasMacro('transform')) {
58
+            Request::macro('transform', function($rules = []) {
59 59
                 $this->replace(
60 60
                     app(Transformer::class)
61 61
                         ->transform($this->all(), $rules)
Please login to merge, or discard this patch.
src/Transform.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@
 block discarded – undo
100 100
      */
101 101
     protected function constructRule($rule, $arguments = []) : string
102 102
     {
103
-        return $rule . (! empty($arguments) ? ':' . implode(',', $arguments) : '');
103
+        return $rule . (!empty($arguments) ? ':' . implode(',', $arguments) : '');
104 104
     }
105 105
 
106 106
     /**
Please login to merge, or discard this patch.
src/helpers.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (! function_exists('str_putcsv')) {
3
+if (!function_exists('str_putcsv')) {
4 4
     function str_putcsv($input, $delimiter = ',', $enclosure = '"')
5 5
     {
6 6
         $fp = fopen('php://temp', 'r+b');
Please login to merge, or discard this patch.
src/RulePacks/RulePack.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
 
18 18
     public function provides()
19 19
     {
20
-        return array_filter(get_class_methods($this), function ($method) {
20
+        return array_filter(get_class_methods($this), function($method) {
21 21
             return substr($method, 0, 4) == 'rule';
22 22
         });
23 23
     }
Please login to merge, or discard this patch.
src/RulePacks/RelatedFieldsRulePack.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
      */
38 38
     public function ruleNullWith($value, $check)
39 39
     {
40
-        return ! is_null($this->transformer->getValue($check)) ? null : $value;
40
+        return !is_null($this->transformer->getValue($check)) ? null : $value;
41 41
     }
42 42
 
43 43
     /*
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
      */
46 46
     public function ruleDropWith($value, $check)
47 47
     {
48
-        $this->transformer->drop(! is_null($this->transformer->getValue($check)));
48
+        $this->transformer->drop(!is_null($this->transformer->getValue($check)));
49 49
 
50 50
         return $value;
51 51
     }
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
     */
56 56
     public function ruleBailWith($value, $check)
57 57
     {
58
-        $this->transformer->bail(! is_null($this->transformer->getValue($check)));
58
+        $this->transformer->bail(!is_null($this->transformer->getValue($check)));
59 59
 
60 60
         return $value;
61 61
     }
Please login to merge, or discard this patch.
src/Transformer.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -413,7 +413,7 @@
 block discarded – undo
413 413
     /**
414 414
      * Check if the Transformer instance has a given rule pack.
415 415
      *
416
-     * @param RulePack|string $rulePack
416
+     * @param RulePack $rulePack
417 417
      * @return bool
418 418
      */
419 419
     public function hasRulePack($rulePack) : bool
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
         $regex = str_replace(['.', '*'], ['\.', '([^\\.|]+)'], $fieldExpression);
282 282
         preg_match_all("/({$regex})/", $this->dataKeysForRegex, $matches, PREG_SET_ORDER);
283 283
 
284
-        return array_reduce($matches, function ($results, $match) {
284
+        return array_reduce($matches, function($results, $match) {
285 285
             $results[$match[0]] = array_slice($match, 2);
286 286
 
287 287
             return $results;
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
      */
349 349
     protected function validateRule($rule) : string
350 350
     {
351
-        if (! isset($this->ruleMethods[$this->getRuleMethod($rule)])) {
351
+        if (!isset($this->ruleMethods[$this->getRuleMethod($rule)])) {
352 352
             throw new InvalidRule($rule);
353 353
         }
354 354
 
@@ -396,11 +396,11 @@  discard block
 block discarded – undo
396 396
         $rulePackClass = $this->getClassName($rulePack);
397 397
         $rulePack = new $rulePackClass;
398 398
 
399
-        if (! ($rulePack instanceof RulePack)) {
399
+        if (!($rulePack instanceof RulePack)) {
400 400
             throw new \UnexpectedValueException('RulePack must be an instance of ' . RulePack::class);
401 401
         }
402 402
 
403
-        if (! $this->hasRulePack($rulePack)) {
403
+        if (!$this->hasRulePack($rulePack)) {
404 404
             $this->rulePacks[$rulePackClass] = $rulePack->transformer($this);
405 405
 
406 406
             $ruleMethods = array_fill_keys($rulePack->provides(), $rulePackClass);
@@ -466,7 +466,7 @@  discard block
 block discarded – undo
466 466
     protected function replaceDataValue($field, $result)
467 467
     {
468 468
         $this->data = $this->data
469
-            ->reject(function ($value, $key) use ($field) {
469
+            ->reject(function($value, $key) use ($field) {
470 470
                 return preg_match("/^{$field}/", $key);
471 471
             })
472 472
             ->merge(Arr::dot([$field => $result]));
Please login to merge, or discard this patch.