Passed
Push — master ( 848038...ea0350 )
by Luiz Kim
02:16
created
src/Repository/ProductRepository.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 
35 35
         try {
36 36
             $conn = $this->getEntityManager()->getConnection();
37
-            $conn->executeStatement('CALL update_product_inventory(?)', [$companies]);
37
+            $conn->executeStatement('CALL update_product_inventory(?)', [ $companies ]);
38 38
         } catch (\Exception $e) {
39 39
             throw new \Exception($e->getMessage());
40 40
         }
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
             ->groupBy('p.id, p.product, p.description, p.sku, pe.id, pe.name, pe.alias, pu.productUnit')
96 96
             ->having('needed > 0')
97 97
             ->addOrderBy('p.product', 'ASC')
98
-            ->setParameter('excludedTypes', ['custom', 'component'])
98
+            ->setParameter('excludedTypes', [ 'custom', 'component' ])
99 99
             ->setParameter(
100 100
                 'companies',
101 101
                 $this->peopleService->getMyCompanies()
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -101,8 +101,9 @@
 block discarded – undo
101 101
                 $this->peopleService->getMyCompanies()
102 102
             );
103 103
 
104
-        if ($company)
105
-            $qb->andWhere('pe = :company')->setParameter('company', $company);
104
+        if ($company) {
105
+                    $qb->andWhere('pe = :company')->setParameter('company', $company);
106
+        }
106 107
 
107 108
         error_log($qb->getQuery()->getSQL());
108 109
         return $qb->getQuery()->getResult();
Please login to merge, or discard this patch.
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.