Passed
Pull Request — master (#1093)
by Iman
06:16
created
src/controllers/ApiController/ExecuteApi.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -52,11 +52,11 @@  discard block
 block discarded – undo
52 52
         | ----------------------------------------------
53 53
         |
54 54
         */
55
-        if (! $row_api->method_type) {
55
+        if (!$row_api->method_type) {
56 56
             return;
57 57
         }
58 58
         $method_type = $row_api->method_type;
59
-        if ($method_type && ! Request::isMethod($method_type)) {
59
+        if ($method_type && !Request::isMethod($method_type)) {
60 60
             $result['api_status'] = 0;
61 61
             $result['api_message'] = "The request method is not allowed !";
62 62
 
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         | ----------------------------------------------
70 70
         |
71 71
         */
72
-        if (! $row_api) {
72
+        if (!$row_api) {
73 73
             $result['api_status'] = 0;
74 74
             $result['api_message'] = 'Sorry this API is no longer available, maybe has changed by admin, or please make sure api url is correct.';
75 75
 
@@ -172,11 +172,11 @@  discard block
 block discarded – undo
172 172
                             $value = $param['config'];
173 173
                         }
174 174
 
175
-                        if ($required && $type == 'password' && ! Hash::check($value, $rows->{$name})) {
175
+                        if ($required && $type == 'password' && !Hash::check($value, $rows->{$name})) {
176 176
                             return $this->passwordError($result, $debug_mode_message, $posts);
177 177
                         }
178 178
 
179
-                        if (! $required && $used && $value && ! Hash::check($value, $row->{$name})) {
179
+                        if (!$required && $used && $value && !Hash::check($value, $row->{$name})) {
180 180
                             return $this->passwordError($result, $debug_mode_message, $posts);
181 181
                         }
182 182
                     }
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
      */
304 304
     private function filterRows($data, $parameters, $posts, $table, $type_except)
305 305
     {
306
-        $data->where(function ($w) use ($parameters, $posts, $table, $type_except) {
306
+        $data->where(function($w) use ($parameters, $posts, $table, $type_except) {
307 307
             foreach ($parameters as $param) {
308 308
                 $name = $param['name'];
309 309
                 $type = $param['type'];
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
                     $row->$k = asset($v);
396 396
                 }
397 397
 
398
-                if (! in_array($k, $responses_fields)) {
398
+                if (!in_array($k, $responses_fields)) {
399 399
                     unset($row[$k]);
400 400
                 }
401 401
             }
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
                 $rows->$k = asset($v);
459 459
             }
460 460
 
461
-            if (! in_array($k, $responses_fields)) {
461
+            if (!in_array($k, $responses_fields)) {
462 462
                 unset($row[$k]);
463 463
             }
464 464
         }
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
             $subquery = $resp['subquery'];
481 481
             $used = intval($resp['used']);
482 482
 
483
-            if ($used == 0 && ! CRUDBooster::isForeignKey($name)) {
483
+            if ($used == 0 && !CRUDBooster::isForeignKey($name)) {
484 484
                 continue;
485 485
             }
486 486
 
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
      */
536 536
     private function applyLike($data, $search_in, $value)
537 537
     {
538
-        $data->where(function ($w) use ($search_in, $value) {
538
+        $data->where(function($w) use ($search_in, $value) {
539 539
             foreach ($search_in as $k => $field) {
540 540
                 if ($k == 0) {
541 541
                     $w->where($field, "like", "%$value%");
Please login to merge, or discard this patch.
src/controllers/ApiController/ValidationRules.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,9 +23,9 @@
 block discarded – undo
23 23
 
24 24
         if (in_array($type, ['unique', 'exists'])) {
25 25
             $format_validation[] = $this->existOrUnique($config, $type);
26
-        } elseif (in_array($type, ['date_format','digits_between', 'in', 'mimes', 'min', 'max', 'not_in'])) {
26
+        } elseif (in_array($type, ['date_format', 'digits_between', 'in', 'mimes', 'min', 'max', 'not_in'])) {
27 27
             $format_validation[] = $type.':'.$config;
28
-        } elseif (! in_array($type, $typeExcept)) {
28
+        } elseif (!in_array($type, $typeExcept)) {
29 29
             $format_validation[] = $type;
30 30
         }
31 31
 
Please login to merge, or discard this patch.
src/controllers/FileController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 {
17 17
     public function uploadSummernote()
18 18
     {
19
-        echo asset(app( FileUploader::class)->uploadFile('userfile'));
19
+        echo asset(app(FileUploader::class)->uploadFile('userfile'));
20 20
     }
21 21
 
22 22
     public function uploadFile()
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
     {
29 29
         $import = app(IndexImport::class);
30 30
         //$this->cbLoader();
31
-        if (! Request::hasFile('userfile')) {
31
+        if (!Request::hasFile('userfile')) {
32 32
             return redirect()->back();
33 33
         }
34 34
         $file = Request::file('userfile');
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
         $fullStoragePath = storage_path('app/'.$fullFilePath);
52 52
 
53 53
 
54
-        if (! Storage::exists($fullFilePath)) {
54
+        if (!Storage::exists($fullFilePath)) {
55 55
             abort(404);
56 56
         }
57 57
         $hasImageExtension = $this->isImage($fullStoragePath);
@@ -86,12 +86,12 @@  discard block
 block discarded – undo
86 86
     {
87 87
         $w = request('w', cbConfig('DEFAULT_THUMBNAIL_WIDTH', 300));
88 88
         $h = request('h', $w);
89
-        $imgRaw = Image::cache(function ($image) use ($fullStoragePath, $w, $h) {
89
+        $imgRaw = Image::cache(function($image) use ($fullStoragePath, $w, $h) {
90 90
             $im = $image->make($fullStoragePath);
91
-            if (! $w) {
91
+            if (!$w) {
92 92
                 return $im;
93 93
             }
94
-            if (! $h) {
94
+            if (!$h) {
95 95
                 $im->fit($w);
96 96
             } else {
97 97
                 $im->fit($w, $h);
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
     {
112 112
         $extension = strtolower(File::extension($fullStoragePath));
113 113
 
114
-        return FieldDetector::isWithin($extension, 'IMAGE_EXTENSIONS');;
114
+        return FieldDetector::isWithin($extension, 'IMAGE_EXTENSIONS'); ;
115 115
     }
116 116
 
117 117
     /**
Please login to merge, or discard this patch.
src/controllers/CBController/Deleter.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
         $this->cbLoader();
24 24
         $selectedIds = request('checkbox');
25 25
         $btnName = request('button_name');
26
-        if (! $selectedIds) {
26
+        if (!$selectedIds) {
27 27
             CB::redirect($_SERVER['HTTP_REFERER'], 'Please select at least one row!', 'warning');
28 28
         }
29 29
         if ($btnName == 'delete') {
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
         $message = cbTrans('alert_action', ['action' => $action]);
48 48
 
49 49
         if ($this->actionButtonSelected($id_selected, $button_name) === false) {
50
-            $message = ! empty($this->alert['message']) ? $this->alert['message'] : 'Error';
51
-            $type = ! empty($this->alert['type']) ? $this->alert['type'] : 'danger';
50
+            $message = !empty($this->alert['message']) ? $this->alert['message'] : 'Error';
51
+            $type = !empty($this->alert['type']) ? $this->alert['type'] : 'danger';
52 52
         }
53 53
 
54 54
         backWithMsg($message, $type);
Please login to merge, or discard this patch.
src/controllers/Helpers/FontAwesome.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
 
5 5
 class FontAwesome
6 6
 {
7
-    public static function cssClass(){
7
+    public static function cssClass() {
8 8
         return [
9 9
             'glass',
10 10
             'music',
Please login to merge, or discard this patch.
src/controllers/Helpers/IndexExport.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,9 +30,9 @@  discard block
 block discarded – undo
30 30
      */
31 31
     public function xls($filename, $response, $orientation)
32 32
     {
33
-        return Excel::create($filename, function ($excel) use ($response, $orientation) {
33
+        return Excel::create($filename, function($excel) use ($response, $orientation) {
34 34
             $excel->setTitle($filename)->setCreator("crudbooster.com")->setCompany(cbGetsetting('appname'));
35
-            $excel->sheet($filename, function ($sheet) use ($response, $orientation) {
35
+            $excel->sheet($filename, function($sheet) use ($response, $orientation) {
36 36
                 $sheet->setOrientation($orientation);
37 37
                 $sheet->loadview('crudbooster::export', $response);
38 38
             });
@@ -46,9 +46,9 @@  discard block
 block discarded – undo
46 46
      */
47 47
     public function csv($filename, $response, $orientation)
48 48
     {
49
-        return Excel::create($filename, function ($excel) use ($response, $orientation) {
49
+        return Excel::create($filename, function($excel) use ($response, $orientation) {
50 50
             $excel->setTitle($filename)->setCreator("crudbooster.com")->setCompany(cbGetsetting('appname'));
51
-            $excel->sheet($filename, function ($sheet) use ($response, $orientation) {
51
+            $excel->sheet($filename, function($sheet) use ($response, $orientation) {
52 52
                 $sheet->setOrientation($orientation);
53 53
                 $sheet->loadview('crudbooster::export', $response);
54 54
             });
Please login to merge, or discard this patch.
src/controllers/Helpers/IndexImport.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     function uploadImportData($file)
51 51
     {
52 52
         $dir = 'uploads/'.date('Y-m');
53
-        $filename = md5(str_random(5)).'.'. $file->getClientOriginalExtension();
53
+        $filename = md5(str_random(5)).'.'.$file->getClientOriginalExtension();
54 54
 
55 55
         //Create Directory Monthly
56 56
         Storage::makeDirectory($dir);
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
      */
68 68
     function validateForImport($file)
69 69
     {
70
-        return Validator::make(['extension' => $file->getClientOriginalExtension(),], ['extension' => 'in:xls,xlsx,csv']);
70
+        return Validator::make(['extension' => $file->getClientOriginalExtension(), ], ['extension' => 'in:xls,xlsx,csv']);
71 71
     }
72 72
 
73 73
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 
84 84
         $file = base64_decode(request('file'));
85 85
         $file = 'storage'.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.$file;
86
-        $rows = Excel::load($file, function ($reader) {
86
+        $rows = Excel::load($file, function($reader) {
87 87
         })->get();
88 88
 
89 89
         //$data_import_column = [];
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
             foreach ($select_column as $sk => $s) {
93 93
                 $colname = $table_columns[$sk];
94 94
 
95
-                if (! CRUDBooster::isForeignKey($colname) || intval($value->$s)) {
95
+                if (!CRUDBooster::isForeignKey($colname) || intval($value->$s)) {
96 96
                     $a[$colname] = $value->$s;
97 97
                     continue;
98 98
                 }
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
                 $relation_moduls = DB::table('cms_moduls')->where('table_name', $relation_table)->first();
107 107
 
108 108
                 $relation_class = __NAMESPACE__.'\\'.$relation_moduls->controller;
109
-                if (! class_exists($relation_class)) {
109
+                if (!class_exists($relation_class)) {
110 110
                     $relation_class = '\App\Http\Controllers\\'.$relation_moduls->controller;
111 111
                 }
112 112
                 $relation_class = new $relation_class;
Please login to merge, or discard this patch.
src/database/migrations/2018_03_05_052641_create_cms_dashboard_table.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -5,32 +5,32 @@
 block discarded – undo
5 5
 
6 6
 class CreateCmsDashboardTable extends Migration {
7 7
 
8
-	/**
9
-	 * Run the migrations.
10
-	 *
11
-	 * @return void
12
-	 */
13
-	public function up()
14
-	{
15
-		Schema::create('cms_dashboard', function(Blueprint $table)
16
-		{
17
-			$table->increments('id');
18
-			$table->string('name')->nullable();
19
-			$table->integer('id_cms_privileges')->nullable();
20
-			$table->text('content')->nullable();
21
-			$table->timestamps();
22
-		});
23
-	}
8
+    /**
9
+     * Run the migrations.
10
+     *
11
+     * @return void
12
+     */
13
+    public function up()
14
+    {
15
+        Schema::create('cms_dashboard', function(Blueprint $table)
16
+        {
17
+            $table->increments('id');
18
+            $table->string('name')->nullable();
19
+            $table->integer('id_cms_privileges')->nullable();
20
+            $table->text('content')->nullable();
21
+            $table->timestamps();
22
+        });
23
+    }
24 24
 
25 25
 
26
-	/**
27
-	 * Reverse the migrations.
28
-	 *
29
-	 * @return void
30
-	 */
31
-	public function down()
32
-	{
33
-		Schema::drop('cms_dashboard');
34
-	}
26
+    /**
27
+     * Reverse the migrations.
28
+     *
29
+     * @return void
30
+     */
31
+    public function down()
32
+    {
33
+        Schema::drop('cms_dashboard');
34
+    }
35 35
 
36 36
 }
Please login to merge, or discard this patch.
database/migrations/2018_03_05_052641_create_cms_email_templates_table.php 1 patch
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -5,37 +5,37 @@
 block discarded – undo
5 5
 
6 6
 class CreateCmsEmailTemplatesTable extends Migration {
7 7
 
8
-	/**
9
-	 * Run the migrations.
10
-	 *
11
-	 * @return void
12
-	 */
13
-	public function up()
14
-	{
15
-		Schema::create('cms_email_templates', function(Blueprint $table)
16
-		{
17
-			$table->increments('id');
18
-			$table->string('name')->nullable();
19
-			$table->string('slug')->nullable();
20
-			$table->string('subject')->nullable();
21
-			$table->text('content')->nullable();
22
-			$table->string('description')->nullable();
23
-			$table->string('from_name')->nullable();
24
-			$table->string('from_email')->nullable();
25
-			$table->string('cc_email')->nullable();
26
-			$table->timestamps();
27
-		});
28
-	}
8
+    /**
9
+     * Run the migrations.
10
+     *
11
+     * @return void
12
+     */
13
+    public function up()
14
+    {
15
+        Schema::create('cms_email_templates', function(Blueprint $table)
16
+        {
17
+            $table->increments('id');
18
+            $table->string('name')->nullable();
19
+            $table->string('slug')->nullable();
20
+            $table->string('subject')->nullable();
21
+            $table->text('content')->nullable();
22
+            $table->string('description')->nullable();
23
+            $table->string('from_name')->nullable();
24
+            $table->string('from_email')->nullable();
25
+            $table->string('cc_email')->nullable();
26
+            $table->timestamps();
27
+        });
28
+    }
29 29
 
30 30
 
31
-	/**
32
-	 * Reverse the migrations.
33
-	 *
34
-	 * @return void
35
-	 */
36
-	public function down()
37
-	{
38
-		Schema::drop('cms_email_templates');
39
-	}
31
+    /**
32
+     * Reverse the migrations.
33
+     *
34
+     * @return void
35
+     */
36
+    public function down()
37
+    {
38
+        Schema::drop('cms_email_templates');
39
+    }
40 40
 
41 41
 }
Please login to merge, or discard this patch.