Completed
Push — master ( 13bbff...a53018 )
by Gilmar
21:55
created
src/Entity/Product/Manager.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -17,11 +17,11 @@
 block discarded – undo
17 17
     protected $entity = 'Product';
18 18
 
19 19
     protected $maps = [
20
-        'save'     => ['POST', '/products'],
21
-        'findById' => ['GET', '/products/{itemId}'],
22
-        'patch'    => ['PATCH', '/products/{itemId}'],
23
-        'update'   => ['PUT', '/products/{itemId}'],
24
-        'fetch'    => ['GET', '/products?page={offset}&size={limit}'],
20
+        'save'     => [ 'POST', '/products' ],
21
+        'findById' => [ 'GET', '/products/{itemId}' ],
22
+        'patch'    => [ 'PATCH', '/products/{itemId}' ],
23
+        'update'   => [ 'PUT', '/products/{itemId}' ],
24
+        'fetch'    => [ 'GET', '/products?page={offset}&size={limit}' ],
25 25
     ];
26 26
 
27 27
     public function save(EntityInterface $product, $route = 'save')
Please login to merge, or discard this patch.
src/Entity/Product/Sku/Manager.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -18,14 +18,14 @@
 block discarded – undo
18 18
     protected $entity = 'SkuCollection';
19 19
 
20 20
     protected $maps = [
21
-        'save'              => ['POST', '/products/{productId}/skus'], //Create a new sku for a product
22
-        'findSkuById'          => ['GET', '/products/{productId}/skus/{itemId}'], // Get the a sku by product Id and sku Id
23
-        'update'            => ['PUT', '/products/{productId}/skus/{sku}/{itemId}'], //Update a product based on SKU
24
-        'findById'          => ['GET', '/products/{itemId}/skus'], //Get the list of product skus
25
-        'saveStatus'        => ['PUT', '/skus/{sku}/bus/{buId}/status'], //Enable or disable sku for sale
26
-        'savePriceSchedule' => ['POST', '/skus/{sku}/priceSchedules'], //Save a price schedule
27
-        'savePrice'         => ['PUT', '/skus/{sku}/prices'], //Save a base price
28
-        'saveStock'         => ['PUT', '/skus/{sku}/stocks'], //Update stock quantity by sku
21
+        'save'              => [ 'POST', '/products/{productId}/skus' ], //Create a new sku for a product
22
+        'findSkuById'          => [ 'GET', '/products/{productId}/skus/{itemId}' ], // Get the a sku by product Id and sku Id
23
+        'update'            => [ 'PUT', '/products/{productId}/skus/{sku}/{itemId}' ], //Update a product based on SKU
24
+        'findById'          => [ 'GET', '/products/{itemId}/skus' ], //Get the list of product skus
25
+        'saveStatus'        => [ 'PUT', '/skus/{sku}/bus/{buId}/status' ], //Enable or disable sku for sale
26
+        'savePriceSchedule' => [ 'POST', '/skus/{sku}/priceSchedules' ], //Save a price schedule
27
+        'savePrice'         => [ 'PUT', '/skus/{sku}/prices' ], //Save a base price
28
+        'saveStock'         => [ 'PUT', '/skus/{sku}/stocks' ], //Update stock quantity by sku
29 29
     ];
30 30
 
31 31
     public function save(EntityInterface $product, $route = 'save')
Please login to merge, or discard this patch.
src/Console/Command/SkuCommand.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
 
22 22
         $app->appendCommand('product:sku:view', 'Mostra os SKUs de um Produto')
23 23
             ->addArgument('productId', InputArgument::REQUIRED, 'Product ID')
24
-            ->setCode(function (InputInterface $input, OutputInterface $output) use ($app) {
25
-                $list = $app->processInputParameters([], $input, $output);
24
+            ->setCode(function(InputInterface $input, OutputInterface $output) use ($app) {
25
+                $list = $app->processInputParameters([ ], $input, $output);
26 26
 
27 27
             $p = $app->factorySdk($list)->factoryManager('sku')->findById($input->getArgument('productId'));
28 28
 
@@ -30,15 +30,15 @@  discard block
 block discarded – undo
30 30
         });
31 31
 
32 32
         $insertOptions = [
33
-            ['key' => 'file'],
33
+            [ 'key' => 'file' ],
34 34
         ];
35 35
 
36 36
         $app->appendCommand('product:sku:update', 'Atualiza um SKU')
37 37
             ->setDefinition($app->factoryDefinition($insertOptions))
38
-            ->setCode(function (InputInterface $input, OutputInterface $output) use ($app, $insertOptions) {
38
+            ->setCode(function(InputInterface $input, OutputInterface $output) use ($app, $insertOptions) {
39 39
                 $list = $app->processInputParameters($insertOptions, $input, $output);
40 40
 
41
-                $data = json_decode(file_get_contents($list['file']), true);
41
+                $data = json_decode(file_get_contents($list[ 'file' ]), true);
42 42
                 $sdk = $app->factorySdk($list);
43 43
                 $product = $sdk->createSku($data);
44 44
 
Please login to merge, or discard this patch.