Passed
Push — master ( c354c0...c003b4 )
by Mohammad
03:37
created
src/Commands/Generator.php 1 patch
Braces   +7 added lines, -5 removed lines patch added patch discarded remove patch
@@ -62,7 +62,9 @@  discard block
 block discarded – undo
62 62
     {
63 63
         $file = preg_split( " (/|\\\\) ", (string)$this->argument('name')) ?? [];
64 64
 
65
-        if(!$file) return "Something wrong with the inputs !";
65
+        if(!$file) {
66
+            return "Something wrong with the inputs !";
67
+        }
66 68
 
67 69
         $this->repoName = $file[count($file) - 1];
68 70
 
@@ -107,8 +109,7 @@  discard block
 block discarded – undo
107 109
         {
108 110
             $createHtml = $this->FormGenerator->generateForm($entity);
109 111
             $editHtml = $this->FormGenerator->generateForm($entity,'put');
110
-        }
111
-        else
112
+        } else
112 113
         {
113 114
             if(!$this->confirm('There is no entity for '.$this->repoName.", do you want to continue (this will disable form generator) ?"))
114 115
             {
@@ -135,8 +136,9 @@  discard block
 block discarded – undo
135 136
     function getEntity($path)
136 137
     {
137 138
         $myClass = 'App\Entities\\'.$path."\\".$this->repoName;
138
-        if(!class_exists($myClass))
139
-            return false;
139
+        if(!class_exists($myClass)) {
140
+                    return false;
141
+        }
140 142
 
141 143
         $refl = new ReflectionClass($myClass);
142 144
 
Please login to merge, or discard this patch.
src/Forms/FormGenerator.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -86,8 +86,9 @@  discard block
 block discarded – undo
86 86
      */
87 87
     function getFillables($entity)
88 88
     {
89
-        if(!empty($entity->getFillable()))
90
-            return $entity->getFillable();
89
+        if(!empty($entity->getFillable())) {
90
+                    return $entity->getFillable();
91
+        }
91 92
 
92 93
         $columns = \Schema::getColumnListing($entity->getTable());
93 94
 
@@ -107,8 +108,9 @@  discard block
 block discarded – undo
107 108
      */
108 109
     function getInputs($entity)
109 110
     {
110
-        if($this->inputs)
111
-            return $this->inputs;
111
+        if($this->inputs) {
112
+                    return $this->inputs;
113
+        }
112 114
 
113 115
         return $this->generateInputs($entity);
114 116
     }
Please login to merge, or discard this patch.
src/Utility/AbstractRepository.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -100,9 +100,9 @@
 block discarded – undo
100 100
                             }
101 101
                         });
102 102
                     });
103
+                } else {
104
+                                    $latest->orWhere($columns, 'like', "%" . $criteria['search'] . "%");
103 105
                 }
104
-                else
105
-                    $latest->orWhere($columns, 'like', "%" . $criteria['search'] . "%");
106 106
             }
107 107
         }
108 108
         unset($criteria['search']);
Please login to merge, or discard this patch.
src/Utility/Controller.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -319,9 +319,10 @@
 block discarded – undo
319 319
         }
320 320
 
321 321
         if ($entity) {
322
-            if($appendEntity)
323
-                return response()->json(  ['status' => true, 'message' => __('repository-generator.success'), 'data' => $entity],
322
+            if($appendEntity) {
323
+                            return response()->json(  ['status' => true, 'message' => __('repository-generator.success'), 'data' => $entity],
324 324
                     JsonResponse::HTTP_OK);
325
+            }
325 326
             return response()->json(null, JsonResponse::HTTP_NO_CONTENT);
326 327
         }
327 328
 
Please login to merge, or discard this patch.