Passed
Push — master ( f5b88e...ee799b )
by Luiz Kim
02:51
created
src/Service/ProductService.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -32,31 +32,31 @@  discard block
 block discarded – undo
32 32
     {
33 33
         $products = $this->getProductsInventory($provider);
34 34
 
35
-        $groupedByInventory = [];
35
+        $groupedByInventory = [ ];
36 36
         foreach ($products as $product) {
37
-            $inventoryName = $product['inventory_name'];
38
-            if (!isset($groupedByInventory[$inventoryName])) {
39
-                $groupedByInventory[$inventoryName] = [];
37
+            $inventoryName = $product[ 'inventory_name' ];
38
+            if (!isset($groupedByInventory[ $inventoryName ])) {
39
+                $groupedByInventory[ $inventoryName ] = [ ];
40 40
             }
41
-            $groupedByInventory[$inventoryName][] = $product;
41
+            $groupedByInventory[ $inventoryName ][ ] = $product;
42 42
         }
43 43
 
44 44
         foreach ($groupedByInventory as $inventoryName => $items) {
45
-            $companyName = $items[0]['company_name'] ;
45
+            $companyName = $items[ 0 ][ 'company_name' ];
46 46
             $this->printService->addLine("", "", "-");
47 47
             $this->printService->addLine($companyName, "", " ");
48
-            $this->printService->addLine("INVENTARIO: " . $inventoryName, "", " ");
48
+            $this->printService->addLine("INVENTARIO: ".$inventoryName, "", " ");
49 49
             $this->printService->addLine("", "", "-");
50 50
             $this->printService->addLine("Produto", "Disponivel", " ");
51 51
             $this->printService->addLine("", "", "-");
52 52
 
53 53
             foreach ($items as $item) {
54
-                $productName = substr($item['product_name'], 0, 20);
55
-                if (!empty($item['description'])) {
56
-                    $productName .= " " . substr($item['description'], 0, 10);
54
+                $productName = substr($item[ 'product_name' ], 0, 20);
55
+                if (!empty($item[ 'description' ])) {
56
+                    $productName .= " ".substr($item[ 'description' ], 0, 10);
57 57
                 }
58
-                $productName .= " (" . $item['productUnit'] . ")";
59
-                $available = str_pad($item['available'], 4, " ", STR_PAD_LEFT);
58
+                $productName .= " (".$item[ 'productUnit' ].")";
59
+                $available = str_pad($item[ 'available' ], 4, " ", STR_PAD_LEFT);
60 60
                 $this->printService->addLine($productName, $available, " ");
61 61
             }
62 62
 
@@ -75,13 +75,13 @@  discard block
 block discarded – undo
75 75
     {
76 76
         $products = $this->getPurchasingSuggestion($provider);
77 77
 
78
-        $groupedByCompany = [];
78
+        $groupedByCompany = [ ];
79 79
         foreach ($products as $product) {
80
-            $companyName = $product['company_name'] ;
81
-            if (!isset($groupedByCompany[$companyName])) {
82
-                $groupedByCompany[$companyName] = [];
80
+            $companyName = $product[ 'company_name' ];
81
+            if (!isset($groupedByCompany[ $companyName ])) {
82
+                $groupedByCompany[ $companyName ] = [ ];
83 83
             }
84
-            $groupedByCompany[$companyName][] = $product;
84
+            $groupedByCompany[ $companyName ][ ] = $product;
85 85
         }
86 86
 
87 87
         $this->printService->addLine("", "", "-");
@@ -95,14 +95,14 @@  discard block
 block discarded – undo
95 95
             $this->printService->addLine("", "", "-");
96 96
 
97 97
             foreach ($items as $item) {
98
-                $productName = substr($item['product_name'], 0, 20);
99
-                if (!empty($item['description'])) {
100
-                    $productName .= " " . substr($item['description'], 0, 10);
98
+                $productName = substr($item[ 'product_name' ], 0, 20);
99
+                if (!empty($item[ 'description' ])) {
100
+                    $productName .= " ".substr($item[ 'description' ], 0, 10);
101 101
                 }
102
-                if (!empty($item['unity'])) {
103
-                    $productName .= " (" . $item['unity'] . ")";
102
+                if (!empty($item[ 'unity' ])) {
103
+                    $productName .= " (".$item[ 'unity' ].")";
104 104
                 }
105
-                $needed = str_pad($item['needed'], 4, " ", STR_PAD_LEFT);
105
+                $needed = str_pad($item[ 'needed' ], 4, " ", STR_PAD_LEFT);
106 106
                 $this->printService->addLine($productName, $needed, " ");
107 107
             }
108 108
 
Please login to merge, or discard this patch.