Completed
Push — master ( 969e0b...dd25b7 )
by Gilmar
21:18
created

Application::getLogFilePath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of gpupo component
5
 * Created by Gilmar Pupo <[email protected]>
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 * For more information, see <http://www.g1mr.com/>.
9
 */
10
namespace Gpupo\NetshoesSdk\Console;
11
12
use Gpupo\CommonSdk\Console\AbstractApplication;
13
use Gpupo\NetshoesSdk\Factory;
14
15
class Application extends AbstractApplication
16
{
17
    protected $commonParameters = [
18
        [
19
            'key' => 'client_id',
20
        ],
21
        [
22
            'key' => 'access_token',
23
        ],
24
        [
25
            'key'     => 'env',
26
            'options' => ['sandbox', 'api'],
27
            'default' => 'sandbox',
28
            'name'    => 'Version',
29
        ],
30
        [
31
            'key'     => 'sslVersion',
32
            'options' => ['SecureTransport', 'TLS'],
33
            'default' => 'SecureTransport',
34
            'name'    => 'SSL Version',
35
        ],
36
        [
37
            'key'     => 'registerPath',
38
            'default' => false,
39
        ]
40
    ];
41
42
    protected function getLogFilePath()
43
    {
44
        return 'var/logs/console.log';
45
    }
46
47
    public function factorySdk(array $options)
48
    {
49
        $options['version'] = $options['env'];
50
51
        return  Factory::getInstance()->setup($options, $this->factoryLogger());
52
    }
53
54
    public function appendCommand($name, $description, array $definition = [])
55
    {
56
        return $this->register($name)
57
            ->setDescription($description)
58
            ->setDefinition($this->factoryDefinition($definition));
59
    }
60
}
61