Passed
Pull Request — 2.0 (#13)
by
unknown
02:02
created
src/Handlers/ModelNotFoundHandler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
         $hasKey = in_array($entityName, $this->translationModelKeys());
60 60
 
61 61
         if ($hasKey) {
62
-            return ! empty($hasKey);
62
+            return !empty($hasKey);
63 63
         }
64 64
 
65 65
         return false;
Please login to merge, or discard this patch.
src/Handlers/NotFoundHttpHandler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
      */
27 27
     public function getNotFoundMessage()
28 28
     {
29
-        $message = ! empty($this->exception->getMessage())
29
+        $message = !empty($this->exception->getMessage())
30 30
             ? $this->exception->getMessage()
31 31
             : class_basename($this->exception);
32 32
 
Please login to merge, or discard this patch.
src/Traits/NotNullArrayable.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
     {
16 16
         $array = [];
17 17
         foreach (get_object_vars($this) as $attribute => $value) {
18
-            if (! is_null($value)) {
18
+            if (!is_null($value)) {
19 19
                 $array[$attribute] = $value instanceof Arrayable ? $value->toArray() : $value;
20 20
             }
21 21
         }
Please login to merge, or discard this patch.
src/JsonApi/ErrorCollection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@
 block discarded – undo
76 76
     public function validatedContent(string $type): ErrorHandledCollectionInterface
77 77
     {
78 78
         foreach ($this->items as $item) {
79
-            if (! $item instanceof $type) {
79
+            if (!$item instanceof $type) {
80 80
                 throw new InvalidContentException('All items on ['.self::class.'] must to be instances of ['.$type.'].');
81 81
             }
82 82
         }
Please login to merge, or discard this patch.
src/Handlers/ValidationHandler.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -48,22 +48,22 @@  discard block
 block discarded – undo
48 48
      */
49 49
     public function getValidationTitle(array $failedFieldsRules, string $key, string $field)
50 50
     {
51
-      if (empty($failedFieldsRules)) {
51
+        if (empty($failedFieldsRules)) {
52 52
         $fails = '';
53
-      } else {
53
+        } else {
54 54
         $fails = strtolower(array_keys($failedFieldsRules[$field])[$key]);
55
-      }
55
+        }
56 56
 
57
-      $title = __('exception::exceptions.validation.title', [
57
+        $title = __('exception::exceptions.validation.title', [
58 58
         'fails' => $fails,
59 59
         'field' => $field,
60
-      ]);
60
+        ]);
61 61
 
62
-      if (is_array($title)) {
62
+        if (is_array($title)) {
63 63
         $title = $title[0];
64
-      }
64
+        }
65 65
 
66
-      return ucfirst(trim($title));
66
+        return ucfirst(trim($title));
67 67
     }
68 68
 
69 69
     /**
@@ -76,12 +76,12 @@  discard block
 block discarded – undo
76 76
      */
77 77
     public function getValidationCode(array $failedFieldsRules, string $key, string $field)
78 78
     {
79
-      if (empty($failedFieldsRules)) {
79
+        if (empty($failedFieldsRules)) {
80 80
         return config('json-exception-handler.codes.validation');
81
-      }
81
+        }
82 82
 
83
-      $rule = strtolower(array_keys($failedFieldsRules[$field])[$key]);
84
-      return config('json-exception-handler.codes.validation_fields.' . $field . '.' . $rule);
83
+        $rule = strtolower(array_keys($failedFieldsRules[$field])[$key]);
84
+        return config('json-exception-handler.codes.validation_fields.' . $field . '.' . $rule);
85 85
     }
86 86
 
87 87
     /**
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
                     ->setTitle($title ?? $this->getDefaultTitle())
28 28
                     ->setDetail($message);
29 29
 
30
-                if (! is_null($code)) {
30
+                if (!is_null($code)) {
31 31
                     $error->setCode($code);
32 32
                 }
33 33
 
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
       }
82 82
 
83 83
       $rule = strtolower(array_keys($failedFieldsRules[$field])[$key]);
84
-      return config('json-exception-handler.codes.validation_fields.' . $field . '.' . $rule);
84
+      return config('json-exception-handler.codes.validation_fields.'.$field.'.'.$rule);
85 85
     }
86 86
 
87 87
     /**
Please login to merge, or discard this patch.