Application   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 24
c 0
b 0
f 0
dl 0
loc 51
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getDefaultCommands() 0 26 2
A getHelp() 0 3 1
1
<?php
2
3
/**
4
 * This file is part of Cecil.
5
 *
6
 * (c) Arnaud Ligny <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Cecil;
15
16
use Symfony\Component\Console\Application as BaseApplication;
17
18
/**
19
 * The console application that handles the commands.
20
 *
21
 * This class extends the Symfony Console Application.
22
 */
23
class Application extends BaseApplication
24
{
25
    /**
26
     * Banner of the application.
27
     * @var string
28
     */
29
    private static $banner = '  ____          _ _
30
 / ___|___  ___(_) |
31
| |   / _ \/ __| | | A simple and powerful content-driven static site generator.
32
| |__|  __/ (__| | |
33
 \____\___|\___|_|_| by Arnaud Ligny
34
35
';
36
37
    /**
38
     * {@inheritdoc}
39
     */
40
    public function getHelp(): string
41
    {
42
        return self::$banner . parent::getHelp();
43
    }
44
45
    /**
46
     * {@inheritdoc}
47
     */
48
    protected function getDefaultCommands(): array
49
    {
50
        $commands = [
51
            new \Symfony\Component\Console\Command\HelpCommand(),
52
            new Command\About(),
53
            new Command\NewSite(),
54
            new Command\NewPage(),
55
            new Command\Edit(),
56
            new Command\Build(),
57
            new Command\Serve(),
58
            new Command\Clear(),
59
            new Command\CacheClear(),
60
            new Command\CacheClearAssets(),
61
            new Command\CacheClearTemplates(),
62
            new Command\CacheClearTranslations(),
63
            new Command\ShowContent(),
64
            new Command\ShowConfig(),
65
            new Command\ListCommand(),
66
            new Command\UtilTranslationsExtract()
67
        ];
68
        if (Util\Platform::isPhar()) {
69
            $commands[] = new Command\SelfUpdate();
70
            $commands[] = new Command\UtilTemplatesExtract();
71
        }
72
73
        return $commands;
74
    }
75
}
76