|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* This file is part of gpupo/netshoes-sdk |
|
5
|
|
|
* Created by Gilmar Pupo <[email protected]> |
|
6
|
|
|
* For the information of copyright and license you should read the file |
|
7
|
|
|
* LICENSE which is distributed with this source code. |
|
8
|
|
|
* Para a informação dos direitos autorais e de licença você deve ler o arquivo |
|
9
|
|
|
* LICENSE que é distribuído com este código-fonte. |
|
10
|
|
|
* Para obtener la información de los derechos de autor y la licencia debe leer |
|
11
|
|
|
* el archivo LICENSE que se distribuye con el código fuente. |
|
12
|
|
|
* For more information, see <http://www.g1mr.com/>. |
|
13
|
|
|
*/ |
|
14
|
|
|
|
|
15
|
|
|
namespace Gpupo\NetshoesSdk\Console\Command; |
|
16
|
|
|
|
|
17
|
|
|
use Closure; |
|
18
|
|
|
use Symfony\Component\Console\Input\InputArgument; |
|
19
|
|
|
use Symfony\Component\Console\Input\InputInterface; |
|
20
|
|
|
use Symfony\Component\Console\Output\OutputInterface; |
|
21
|
|
|
|
|
22
|
|
|
/** |
|
23
|
|
|
* @codeCoverageIgnore |
|
24
|
|
|
*/ |
|
25
|
|
|
class ScreenplayCommand extends AbstractCommand |
|
26
|
|
|
{ |
|
27
|
|
|
protected $list = ['all', 'productPostSimple','productPostMultiple', 'productUpdate', |
|
28
|
|
|
'productUpdateFull']; |
|
29
|
|
|
|
|
30
|
|
|
protected function runIfExists($name, $input, $output) |
|
31
|
|
|
{ |
|
32
|
|
|
try { |
|
33
|
|
|
$c = $this->getApp()->find($name); |
|
34
|
|
|
$this->sendInfo('<fg=cyan>'.$name.'</fg=cyan>()'); |
|
|
|
|
|
|
35
|
|
|
|
|
36
|
|
|
return $c->run($input, $output); |
|
37
|
|
|
} catch (\Exception $e) { |
|
38
|
|
|
$this->getLogger()->addDebug($e->getMessage()); |
|
|
|
|
|
|
39
|
|
|
} |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
public function all($app) |
|
|
|
|
|
|
43
|
|
|
{ |
|
44
|
|
|
$this->getApp()->appendCommand('screenplay:run', 'Run all'); |
|
45
|
|
|
} |
|
46
|
|
|
|
|
47
|
|
View Code Duplication |
public function productPostSimple($app) |
|
|
|
|
|
|
48
|
|
|
{ |
|
49
|
|
|
$this->getApp()->appendCommand('screenplay:product:post:simple', '') |
|
50
|
|
|
->setCode(function (InputInterface $input, OutputInterface $output) use ($app) { |
|
51
|
|
|
$list = $app->processInputParameters([], $input, $output); |
|
|
|
|
|
|
52
|
|
|
$output->writeln('Cadastro de quatro produtos contendo apenas um Sku'); |
|
53
|
|
|
|
|
54
|
|
|
|
|
55
|
|
|
throw new \Exception("Implementar!"); |
|
56
|
|
|
}); |
|
57
|
|
|
} |
|
58
|
|
|
|
|
59
|
|
View Code Duplication |
public function productPostMultiple($app) |
|
|
|
|
|
|
60
|
|
|
{ |
|
61
|
|
|
$this->getApp()->appendCommand('screenplay:product:post:multiple', '') |
|
62
|
|
|
->setCode(function (InputInterface $input, OutputInterface $output) use ($app) { |
|
63
|
|
|
$list = $app->processInputParameters([], $input, $output); |
|
|
|
|
|
|
64
|
|
|
$output->writeln('Cadastro de quatro produtos contendo mais de um Sku'); |
|
65
|
|
|
|
|
66
|
|
|
throw new \Exception("Implementar!"); |
|
67
|
|
|
}); |
|
68
|
|
|
} |
|
69
|
|
|
|
|
70
|
|
View Code Duplication |
public function productUpdate($app) |
|
|
|
|
|
|
71
|
|
|
{ |
|
72
|
|
|
$this->getApp()->appendCommand('screenplay:product:update', '') |
|
73
|
|
|
->setCode(function (InputInterface $input, OutputInterface $output) use ($app) { |
|
74
|
|
|
$list = $app->processInputParameters([], $input, $output); |
|
|
|
|
|
|
75
|
|
|
$output->writeln('Atualizar parcialmente no mínimo quatro produtos criados. As alterações devem incluir department, productType e attibutes'); |
|
76
|
|
|
|
|
77
|
|
|
throw new \Exception("Implementar!"); |
|
78
|
|
|
}); |
|
79
|
|
|
} |
|
80
|
|
|
|
|
81
|
|
|
|
|
82
|
|
View Code Duplication |
public function productUpdateFull($app) |
|
|
|
|
|
|
83
|
|
|
{ |
|
84
|
|
|
$this->getApp()->appendCommand('screenplay:product:update:full', '') |
|
85
|
|
|
->setCode(function (InputInterface $input, OutputInterface $output) use ($app) { |
|
86
|
|
|
$list = $app->processInputParameters([], $input, $output); |
|
|
|
|
|
|
87
|
|
|
$output->writeln('Atualizar três produtos cadastrados. As atualizações devem mudar o produto por completo exceto ID e SKU'); |
|
88
|
|
|
|
|
89
|
|
|
throw new \Exception("Implementar!"); |
|
90
|
|
|
}); |
|
91
|
|
|
} |
|
92
|
|
|
|
|
93
|
|
|
} |
|
94
|
|
|
|
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.