Passed
Push — master ( 6773bd...a44cc7 )
by Iman
04:18
created
src/helpers/DbInspector.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
     {
45 45
         $colObj = \DB::getDoctrineSchemaManager()->listTableColumns($table)[$colName];
46 46
         if(!$colObj){
47
-           return ;
47
+            return ;
48 48
         }
49 49
         return !$colObj->getNotnull();
50 50
     }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
      */
17 17
     public static function findPK($table)
18 18
     {
19
-        if (! $table) {
19
+        if (!$table) {
20 20
             return 'id';
21 21
         }
22 22
 
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 
28 28
         $primaryKey = self::findPKname($table);
29 29
 
30
-        if (! $primaryKey) {
30
+        if (!$primaryKey) {
31 31
             return 'id';
32 32
         }
33 33
         CbCache::put('table_'.$table, 'primaryKey', $primaryKey);
@@ -43,8 +43,8 @@  discard block
 block discarded – undo
43 43
     public static function isNullableColumn($table, $colName)
44 44
     {
45 45
         $colObj = \DB::getDoctrineSchemaManager()->listTableColumns($table)[$colName];
46
-        if(!$colObj){
47
-           return ;
46
+        if (!$colObj) {
47
+           return;
48 48
         }
49 49
         return !$colObj->getNotnull();
50 50
     }
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
         }
82 82
 
83 83
         $table = self::getTableForeignKey($fieldName);
84
-        if (! $table) {
84
+        if (!$table) {
85 85
             return false;
86 86
         }
87 87
 
Please login to merge, or discard this patch.
src/Modules/ModuleGenerator/AdminModulesController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
     {
16 16
         $this->table = 'cms_moduls';
17 17
         $this->primaryKey = 'id';
18
-        $this->titleField = 'name' ;
18
+        $this->titleField = 'name';
19 19
         $this->limit = 100;
20 20
         $this->buttonAdd = false;
21 21
         $this->buttonExport = false;
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 
56 56
     function hookBeforeDelete($ids)
57 57
     {
58
-        foreach ($ids as $id){
58
+        foreach ($ids as $id) {
59 59
             $controller = ModulesRepo::getControllerName($id);
60 60
             DB::table('cms_menus')->where('path', 'like', '%'.$controller.'%')->delete();
61 61
             @unlink(controller_path($controller));
Please login to merge, or discard this patch.
src/CBCoreModule/FileUploader.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 {
11 11
     public function uploadFile($name)
12 12
     {
13
-        if (! Request::hasFile($name)) {
13
+        if (!Request::hasFile($name)) {
14 14
             return null;
15 15
         }
16 16
         $file = Request::file($name);
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
      */
34 34
     private function validateExtension($ext)
35 35
     {
36
-        if (! FieldDetector::isUploadField($ext)) {
36
+        if (!FieldDetector::isUploadField($ext)) {
37 37
             sendAndTerminate(response()->json("The filetype is not allowed!"));
38 38
         }
39 39
     }
Please login to merge, or discard this patch.
src/CBCoreModule/Index/Order.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
     public function handle($result, $table)
24 24
     {
25 25
         $orderby = $this->ctrl->orderby;
26
-        if (! $orderby) {
26
+        if (!$orderby) {
27 27
             $result->orderby($table.'.'.$this->ctrl->primaryKey, 'desc');
28 28
             return;
29 29
         }
Please login to merge, or discard this patch.
src/helpers/CRUDBooster.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
     public static function first($table, $id)
97 97
     {
98 98
         $table = self::parseSqlTable($table)['table'];
99
-        if (! is_array($id)) {
99
+        if (!is_array($id)) {
100 100
             $pk = DbInspector::findPK($table);
101 101
 
102 102
             return DB::table($table)->where($pk, $id)->first();
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
         $controllerName = basename($controllerName);
123 123
         $routeUrl = route($controllerName.'GetIndex');
124 124
 
125
-        if (! $path) {
125
+        if (!$path) {
126 126
             return trim($routeUrl, '/');
127 127
         }
128 128
 
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
     {
153 153
         $tables = DbInspector::listTables();
154 154
 
155
-        $filter = function ($tableName) {
155
+        $filter = function($tableName) {
156 156
 
157 157
             if ($tableName == config('database.migrations')) {
158 158
                 return false;
Please login to merge, or discard this patch.
src/Modules/ApiGeneratorModule/AdminColumnsTableController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -26,8 +26,8 @@  discard block
 block discarded – undo
26 26
 
27 27
         $result = \Schema::getColumnListing($table);
28 28
 
29
-        $result = array_filter($result, function ($row) {
30
-            return ! (in_array($row, ['created_at', 'deleted_at', 'updated_at']));
29
+        $result = array_filter($result, function($row) {
30
+            return !(in_array($row, ['created_at', 'deleted_at', 'updated_at']));
31 31
         });
32 32
 
33 33
         $newResult = [];
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
             $type = \Schema::getColumnType($table, $row);
36 36
             $newResult[] = ['name' => $row, 'type' => $this->getFieldType($row, $type)];
37 37
 
38
-            if (! in_array($type, ['list', 'detail']) || ! starts_with($row, 'id_')) {
38
+            if (!in_array($type, ['list', 'detail']) || !starts_with($row, 'id_')) {
39 39
                 continue;
40 40
             }
41 41
 
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
         }
81 81
         $table2 = substr($ro, 3);
82 82
         $columns = DB::getSchemaBuilder()->getColumnListing($table2);
83
-        $columns = array_filter($columns, function ($col) {
84
-            return ! FieldDetector::isExceptional($col);
83
+        $columns = array_filter($columns, function($col) {
84
+            return !FieldDetector::isExceptional($col);
85 85
         });
86 86
 
87 87
         foreach ($columns as $col) {
Please login to merge, or discard this patch.
src/CBCoreModule/CbRouter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
     {
61 61
         $methods = (new \ReflectionClass($ctrl))->getMethods(\ReflectionMethod::IS_PUBLIC);
62 62
 
63
-        return array_filter($methods, function ($method) {
63
+        return array_filter($methods, function($method) {
64 64
             return ($method->class !== 'Illuminate\Routing\Controller' && $method->name !== 'getIndex');
65 65
         });
66 66
     }
Please login to merge, or discard this patch.
src/CBCoreModule/Index.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
         if ($filter_is_orderby === true) {
69 69
             (new Order($this->cb))->handle($result, $table);
70 70
         }
71
-        $limit = is_string($limit) ? (int)$limit : 15;
71
+        $limit = is_string($limit) ? (int) $limit : 15;
72 72
         $data['result'] = $result->paginate($limit);
73 73
 
74 74
         $data['columns'] = $columns_table;
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
         //LISTING INDEX HTML
81 81
         $addAction = $CbCtrl->data['addAction'];
82 82
 
83
-        if (! empty($CbCtrl->sub_module)) {
83
+        if (!empty($CbCtrl->sub_module)) {
84 84
             $addAction = $this->_handleSubModules($addAction);
85 85
         }
86 86
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
     private function _handleParentTable()
102 102
     {
103 103
         $data = [];
104
-        $parent = (string)request('parent_table');
104
+        $parent = (string) request('parent_table');
105 105
         $pk = DbInspector::findPk(request('parent_table'));
106 106
 
107 107
         $data['parent_table'] = DB::table($parent)->where($pk, request('parent_id'))->first();
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
             $data['parent_field'] = DbInspector::getTableForeignKey($parent);
112 112
         }
113 113
 
114
-        if (! $data['parent_field']) {
114
+        if (!$data['parent_field']) {
115 115
             return $data;
116 116
         }
117 117
 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
      */
130 130
     private function _filterForParent($result)
131 131
     {
132
-        if (! request('parent_id')) {
132
+        if (!request('parent_id')) {
133 133
             return null;
134 134
         }
135 135
 
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
      */
144 144
     private function _filterOutSoftDeleted($tableColumns, $result)
145 145
     {
146
-        if (! in_array('deleted_at', $tableColumns)) {
146
+        if (!in_array('deleted_at', $tableColumns)) {
147 147
             return;
148 148
         }
149 149
         $result->where($this->table.'.deleted_at', '=', null);
@@ -202,9 +202,9 @@  discard block
 block discarded – undo
202 202
     private function _applyWhereAndQfilters($result, $columnsTable, $table)
203 203
     {
204 204
         if (request('q')) {
205
-            $result->where(function ($query) use ($columnsTable) {
205
+            $result->where(function($query) use ($columnsTable) {
206 206
                 foreach ($columnsTable as $col) {
207
-                    if (! $col['field_with']) {
207
+                    if (!$col['field_with']) {
208 208
                         continue;
209 209
                     }
210 210
                     $query->orwhere($col['field_with'], "like", "%".request("q")."%");
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
         return CRUDBooster::adminPath($module['path']).'?parent_table='.$table_parent.'&parent_columns='
249 249
             .$module['parent_columns'].'&parent_columns_alias='
250 250
             .$module['parent_columns_alias'].'&parent_id=['
251
-            .(! isset($module['custom_parent_id']) ? "id" : $module['custom_parent_id'])
251
+            .(!isset($module['custom_parent_id']) ? "id" : $module['custom_parent_id'])
252 252
             .']&return_url='.urlencode(Request::fullUrl()).'&foreign_key='
253 253
             .$module['foreign_key'].'&label='.urlencode($module['label']);
254 254
     }
Please login to merge, or discard this patch.