Completed
Push — symfony-console ( 9880c9...5f68e3 )
by Arnaud
05:25 queued 03:30
created

Application::getDefaultInputDefinition()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/*
3
 * Copyright (c) Arnaud Ligny <[email protected]>
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
9
namespace Cecil;
10
11
use Symfony\Component\Console\Application as BaseApplication;
12
use Symfony\Component\Console\Input\InputArgument;
13
14
/**
15
 * The console application that handles the commands.
16
 */
17
class Application extends BaseApplication
18
{
19
    private static $banner = '  ____          _ _
20
 / ___|___  ___(_) | Your content driven
21
| |   / _ \/ __| | | static site generator.
22
| |__|  __/ (__| | |
23
 \____\___|\___|_|_| by Arnaud Ligny
24
';
25
26
    public function getHelp()
27
    {
28
        return self::$banner.parent::getHelp();
29
    }
30
31
    /**
32
     * Initializes all the composer commands.
33
     */
34
    protected function getDefaultCommands()
35
    {
36
        $commands = array_merge(parent::getDefaultCommands(), [
37
            new Command\CommandTest(),
38
        ]);
39
        if (Util\Plateform::isPhar()) {
40
            $commands[] = new Command\SelfUpdate($this->getVersion());
41
        }
42
43
        return $commands;
44
    }
45
46
    protected function getDefaultInputDefinition()
47
    {
48
        $definition = parent::getDefaultInputDefinition();
49
        $definition->addArgument(new InputArgument('path', InputArgument::OPTIONAL, 'Path to the Website'));
50
51
        return $definition;
52
    }
53
}
54