Test Failed
Push — master ( 1f85df...a52154 )
by Gianluca
05:34
created
src/Http/Controllers/admin/AdminConfigurationFieldController.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
 class AdminConfigurationFieldController extends Controller
14 14
 {
15
-    public function setNewConfiguration(Request $r){
15
+    public function setNewConfiguration(Request $r) {
16 16
 
17 17
         $r->validate([
18 18
             'name' => 'required',
@@ -33,11 +33,11 @@  discard block
 block discarded – undo
33 33
         return response()->json(true);
34 34
     }
35 35
 
36
-    public function getConfigurationFields(Request $r){
36
+    public function getConfigurationFields(Request $r) {
37 37
         $category_id = $r->get('category_id');
38
-        $configurationFields = ConfigurationField::where('category_id',$category_id)->get();
38
+        $configurationFields = ConfigurationField::where('category_id', $category_id)->get();
39 39
         $d = [];
40
-        foreach ($configurationFields as $field){
40
+        foreach ($configurationFields as $field) {
41 41
             $d[] = [
42 42
                 'name' => $field->name,
43 43
                 'type' => $field->type,
@@ -48,14 +48,14 @@  discard block
 block discarded – undo
48 48
 
49 49
     }
50 50
 
51
-    public function generateConfigurationFieldHtml($field){
51
+    public function generateConfigurationFieldHtml($field) {
52 52
         $type = $field->type;
53 53
         $html = '';
54
-        if($type === 'textarea'){
54
+        if ($type === 'textarea') {
55 55
             $html = '';
56
-            $html .= '<textarea data-configuration_id="'.$field->id .'" class="form-control mongiconfigurationfield"></textarea>';
57
-        }else{
58
-            $html .= '<input type="'.$type.'" data-configuration_id="'.$field->id .'" class="form-control mongiconfigurationfield">';
56
+            $html .= '<textarea data-configuration_id="'.$field->id.'" class="form-control mongiconfigurationfield"></textarea>';
57
+        } else {
58
+            $html .= '<input type="'.$type.'" data-configuration_id="'.$field->id.'" class="form-control mongiconfigurationfield">';
59 59
         }
60 60
         return $html;
61 61
     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
         if($type === 'textarea'){
55 55
             $html = '';
56 56
             $html .= '<textarea data-configuration_id="'.$field->id .'" class="form-control mongiconfigurationfield"></textarea>';
57
-        }else{
57
+        } else{
58 58
             $html .= '<input type="'.$type.'" data-configuration_id="'.$field->id .'" class="form-control mongiconfigurationfield">';
59 59
         }
60 60
         return $html;
Please login to merge, or discard this patch.
src/Http/Controllers/admin/AdminSettingsController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,8 +8,8 @@
 block discarded – undo
8 8
 
9 9
 class AdminSettingsController
10 10
 {
11
-    public function page(){
11
+    public function page() {
12 12
         $settings = AdminSetting::first();
13
-        return view('mongicommerce::admin.pages.settings',['settings' => $settings]);
13
+        return view('mongicommerce::admin.pages.settings', ['settings' => $settings]);
14 14
     }
15 15
 }
Please login to merge, or discard this patch.
migrations/2020_12_22_085261_create_product_configuration_field_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('product_configuration_fields', function (Blueprint $table) {
16
+        Schema::create('product_configuration_fields', function(Blueprint $table) {
17 17
             $table->id();
18 18
             $table->unsignedBigInteger('product_item_id');
19 19
             $table->unsignedBigInteger('config_field_id');
Please login to merge, or discard this patch.
database/migrations/2020_12_28_085261_create_admin_settings_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public function up()
15 15
     {
16
-        Schema::create('admin_settings', function (Blueprint $table) {
16
+        Schema::create('admin_settings', function(Blueprint $table) {
17 17
             $table->id();
18 18
             $table->string('shop_name')->default('MongiCommerce');
19 19
             $table->string('iban')->default('DE79100110012626219557');
Please login to merge, or discard this patch.
src/Models/Category.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,11 +29,11 @@
 block discarded – undo
29 29
         return $this->children_rec()->with('children');
30 30
     }
31 31
 
32
-    public function configuration_fields(){
32
+    public function configuration_fields() {
33 33
         return $this->hasMany(ConfigurationField::class);
34 34
     }
35 35
 
36
-    public function products(){
36
+    public function products() {
37 37
         return $this->hasMany(Product::class);
38 38
     }
39 39
 
Please login to merge, or discard this patch.
src/Http/Controllers/shop/ShopShowVariationProductController.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -24,14 +24,14 @@  discard block
 block discarded – undo
24 24
 
25 25
         $g = '';
26 26
         foreach ($informations as $key => $information) {
27
-            $information = (object)$information;
27
+            $information = (object) $information;
28 28
             $product_detail_id = $information->product_detail_id;
29 29
             $product_detail_value_id = $information->product_detail_value_id;
30 30
             $condition = '';
31 31
 
32
-            if(count($informations) == $key +1){
32
+            if (count($informations) == $key + 1) {
33 33
                 $condition = '';
34
-            }else{
34
+            } else {
35 35
                 $condition = 'or';
36 36
             }
37 37
             $g .= ('(a.product_detail_id ='.$product_detail_id.' and a.product_detail_value_id ='.$product_detail_value_id.') '.$condition.'');
@@ -40,16 +40,16 @@  discard block
 block discarded – undo
40 40
 
41 41
         $result = $q->first();
42 42
 
43
-        if($result){
43
+        if ($result) {
44 44
             $filters = $result->num_details >= count($informations);
45
-            if($filters){
45
+            if ($filters) {
46 46
                 $product_item_id = $result->product_item_id;
47 47
 
48
-                return response()->json(route('shop.single.product',[$product_id,$product_item_id]));
49
-            }else{
48
+                return response()->json(route('shop.single.product', [$product_id, $product_item_id]));
49
+            } else {
50 50
                 return response()->json(false);
51 51
             }
52
-        }else{
52
+        } else {
53 53
             return response()->json(false);
54 54
         }
55 55
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
             if(count($informations) == $key +1){
33 33
                 $condition = '';
34
-            }else{
34
+            } else{
35 35
                 $condition = 'or';
36 36
             }
37 37
             $g .= ('(a.product_detail_id ='.$product_detail_id.' and a.product_detail_value_id ='.$product_detail_value_id.') '.$condition.'');
@@ -46,10 +46,10 @@  discard block
 block discarded – undo
46 46
                 $product_item_id = $result->product_item_id;
47 47
 
48 48
                 return response()->json(route('shop.single.product',[$product_id,$product_item_id]));
49
-            }else{
49
+            } else{
50 50
                 return response()->json(false);
51 51
             }
52
-        }else{
52
+        } else{
53 53
             return response()->json(false);
54 54
         }
55 55
 
Please login to merge, or discard this patch.
src/Http/Controllers/shop/ShopController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -11,14 +11,14 @@
 block discarded – undo
11 11
 
12 12
 class ShopController extends Controller
13 13
 {
14
-    public function page($category_id=null){
14
+    public function page($category_id = null) {
15 15
         $products = Template::getProducts($category_id);
16 16
         $category = Category::find($category_id);
17 17
         $category_name = '';
18 18
         $category_description = '';
19
-        if($category){
19
+        if ($category) {
20 20
             $category_name = $category->name;
21 21
         };
22
-        return view('mongicommerce.pages.shop',compact('products','category_name','category_description'));
22
+        return view('mongicommerce.pages.shop', compact('products', 'category_name', 'category_description'));
23 23
     }
24 24
 }
Please login to merge, or discard this patch.
src/Http/Controllers/admin/AdminUpdatePackageController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
 
10 10
 class AdminUpdatePackageController extends Controller
11 11
 {
12
-    public function update(){
12
+    public function update() {
13 13
         #$dd = shell_exec('cd .. && composer update mongi/mongicommerce');
14 14
         $dd = shell_exec('cd .. && php artisan mongicommerce:update');
15 15
         echo '<pre>';
Please login to merge, or discard this patch.
src/Http/Controllers/admin/AdminNewProductVariationController.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -15,14 +15,14 @@  discard block
 block discarded – undo
15 15
 
16 16
 class AdminNewProductVariationController extends Controller
17 17
 {
18
-    public function page($id_product){
18
+    public function page($id_product) {
19 19
         $product = Product::find($id_product);
20 20
         $items = $product->items;
21 21
 
22
-        return view('mongicommerce::admin.pages.products.new_product_variation',['product' => $product,'items' => $items]);
22
+        return view('mongicommerce::admin.pages.products.new_product_variation', ['product' => $product, 'items' => $items]);
23 23
     }
24 24
 
25
-    public function createNewVariation(Request $r){
25
+    public function createNewVariation(Request $r) {
26 26
         $r->validate([
27 27
             'category_id' => 'required',
28 28
             'quantity' => 'required',
@@ -32,8 +32,8 @@  discard block
 block discarded – undo
32 32
         ]);
33 33
         $product_id = $r->get('product_id');
34 34
 
35
-        $details = json_decode($r->get('details'),true);
36
-        $configuration_fields = json_decode($r->get('configuration_fields'),true);
35
+        $details = json_decode($r->get('details'), true);
36
+        $configuration_fields = json_decode($r->get('configuration_fields'), true);
37 37
         $quantity = $r->get('quantity');
38 38
         $price = $r->get('price');
39 39
         $product_name = $r->get('product_name');
@@ -51,12 +51,12 @@  discard block
 block discarded – undo
51 51
         $product_item->quantity = $quantity;
52 52
         $product_item->save();
53 53
 
54
-        $base64_str = substr($get_image, strpos($get_image, ",")+1);
54
+        $base64_str = substr($get_image, strpos($get_image, ",") + 1);
55 55
         $image = base64_decode($base64_str);
56 56
         $destinationPath = public_path().'/uploads/products_img/'.$product_item->product_id.'/'.$product_item->id.'/';
57 57
         $destinationPathDB = url('/').'/uploads/products_img/'.$product_item->product_id.'/'.$product_item->id.'/';
58 58
 
59
-        if(!File::isDirectory($destinationPath)){
59
+        if (!File::isDirectory($destinationPath)) {
60 60
             File::makeDirectory($destinationPath, $mode = 0777, true, true);
61 61
         }
62 62
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
         $product_item->image = $dbPath;
69 69
         $product_item->save();
70 70
 
71
-        foreach($details as $detail){
71
+        foreach ($details as $detail) {
72 72
             $detail_obj = (object) $detail;
73 73
             $product_detail = new ProductItemDetail();
74 74
             $product_detail->product_item_id = $product_item->id;
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
             $product_detail->save();
78 78
         }
79 79
 
80
-        foreach ($configuration_fields as $conf_field){
80
+        foreach ($configuration_fields as $conf_field) {
81 81
             $conf_fields_obj = (object) $conf_field;
82 82
             $configuration_field = new ProductConfigurationField();
83 83
             $configuration_field->product_item_id = $product_item->id;
Please login to merge, or discard this patch.