AbstractConsoleTask::getConsoleCommand()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 2
1
<?php
2
/**
3
 * This file is part of the teamneusta/magallanes-task-typo3 package.
4
 *
5
 * Copyright (c) 2017 neusta GmbH | Ein team neusta Unternehmen
6
 *
7
 * For the full copyright and license information, please view the LICENSE file that was distributed with this source code.
8
 *
9
 * @license http://www.opensource.org/licenses/mit-license.html  MIT License
10
 */
11
declare(strict_types=1);
12
13
namespace TeamNeusta\Magallanes\Task\TYPO3\Console;
14
15
use TeamNeusta\Magallanes\Task\TYPO3\AbstractTypo3Task;
16
17
/**
18
 * Class AbstractConsoleTask
19
 *
20
 * @author Benjamin Kluge <[email protected]>
21
 * @package TeamNeusta\Magallanes\Task\TYPO3\Console
22
 */
23
abstract class AbstractConsoleTask extends AbstractTypo3Task
24
{
25
26
    /**
27
     * getConsoleCommand
28
     *
29
     * @param $consoleCommandName
30
     * @param array $options
31
     *
32
     * @return string
33
     */
34
    protected function getConsoleCommand(string $consoleCommandName, array $options): string
35
    {
36
        return sprintf(
37
            $this->getContextCommand('%s %s ', $options),
38
            $options['console'],
39
            $consoleCommandName
40
        );
41
    }
42
43
    /**
44
     * getOptions
45
     *
46
     * @param array $defaults
47
     * @return array
48
     */
49
    protected function getOptions(array $defaults): array
50
    {
51
        return parent::getOptions(array_merge(['console' => 'vendor/bin/typo3cms'], $defaults));
52
    }
53
}
54