Completed
Push — master ( b5ae03...92b30b )
by Sebastian
07:15 queued 04:19
created

Application::getHelp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * This file is part of CaptainHook.
4
 *
5
 * (c) Sebastian Feldmann <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace SebastianFeldmann\CaptainHook\Console;
11
12
use SebastianFeldmann\CaptainHook\CH;
13
use Symfony\Component\Console\Application as SymfonyApplication;
14
15
/**
16
 * Class Application
17
 *
18
 * @package CaptainHook
19
 * @author  Sebastian Feldmann <[email protected]>
20
 * @link    https://github.com/sebastianfeldmann/captainhook
21
 * @since   Class available since Release 0.9.0
22
 */
23
class Application extends SymfonyApplication
24
{
25
    /**
26
     * @var \SebastianFeldmann\CaptainHook\Config
27
     */
28
    protected $config;
29
30
    /**
31
     * @var string
32
     */
33
    private static $logo = '   .oooooo.                            .              o8o              
34
  d8P\'  `Y8b                         .o8              `"\'              
35
 888           .oooo.   oo.ooooo.  .o888oo  .oooo.   oooo  ooo. .oo.   
36
 888          `P  )88b   888\' `88b   888   `P  )88b  `888  `888P"Y88b  
37
 888           .oP"888   888   888   888    .oP"888   888   888   888  
38
 `88b    ooo  d8(  888   888   888   888 . d8(  888   888   888   888  
39
  `Y8bood8P\'  `Y888""8o  888bod8P\'   "888" `Y888""8o o888o o888o o888o 
40
                         888                                           
41
                        o888o
42
      
43
                         .ed"""" """$$$$be.                     
44
                       -"           ^""**$$$e.                  
45
                     ."                   \'$$$c                 
46
                    /                      "4$$b                
47
                   d  3                     $$$$                
48
                   $  *                   .$$$$$$               
49
                  .$  ^c           $$$$$e$$$$$$$$.              
50
                  d$L  4.         4$$$$$$$$$$$$$$b              
51
                  $$$$b ^ceeeee.  4$$ECL.F*$$$$$$$              
52
      e$""=.      $$$$P d$$$$F $ $$$$$$$$$- $$$$$$              
53
     z$$b. ^c     3$$$F "$$$$b   $"$$$$$$$  $$$$*"      .=""$c  
54
    4$$$$L   \     $$P"  "$$b   .$ $$$$$...e$$        .=  e$$$. 
55
    ^*$$$$$c  %..   *c    ..    $$ 3$$$$$$$$$$eF     zP  d$$$$$ 
56
      "**$$$ec   "\   %ce""    $$$  $$$$$$$$$$*    .r" =$$$$P"" 
57
            "*$b.  "c  *$e.    *** d$$$$$"L$$    .d"  e$$***"   
58
              ^*$$c ^$c $$$      4J$$$$$% $$$ .e*".eeP"         
59
                 "$$$$$$"\'$=e....$*$$**$cz$$" "..d$*"           
60
                   "*$$$  *=%4.$ L L$ P3$$$F $$$P"              
61
                      "$   "%*ebJLzb$e$$$$$b $P"                
62
                        %..      4$$$$$$$$$$ "                  
63
                         $$$e   z$$$$$$$$$$%                    
64
                          "*$c  "$$$$$$$P"                      
65
                           ."""*$$$$$$$$bc                      
66
                        .-"    .$***$$$"""*e.                   
67
                     .-"    .e$"     "*$c  ^*b.                 
68
              .=*""""    .e$*"          "*bc  "*$e..            
69
            .$"        .z*"               ^*$e.   "*****e.      
70
            $$ee$c   .d"                     "*$.        3.     
71
            ^*$E")$..$"                         *   .ee==d%     
72
               $.d$$$*                           *  J$$$e*      
73
                """""                             "$$$"
74
75
             ooooo   ooooo                     oooo        
76
             `888\'   `888\'                     `888        
77
              888     888   .ooooo.   .ooooo.   888  oooo  
78
              888ooooo888  d88\' `88b d88\' `88b  888 .8P\'   
79
              888     888  888   888 888   888  888888.    
80
              888     888  888   888 888   888  888 `88b.  
81
             o888o   o888o `Y8bod8P\' `Y8bod8P\' o888o o888o 
82
83
';
84
85
    /**
86
     * Input output interface
87
     *
88
     * @var \SebastianFeldmann\CaptainHook\Console\IO
89
     */
90
    protected $io;
91
92
    /**
93
     * Application constructor.
94
     */
95 9
    public function __construct()
96
    {
97 9
        if (function_exists('ini_set') && extension_loaded('xdebug')) {
98 9
            ini_set('xdebug.show_exception_trace', false);
99 9
            ini_set('xdebug.scream', false);
100
        }
101 9
        parent::__construct('CaptainHook', CH::VERSION);
102
103 9
        $this->setDefaultCommand('help');
104 9
    }
105
106
    /**
107
     * Append release date to version output.
108
     *
109
     * @return string
110
     */
111 1
    public function getLongVersion()
112
    {
113 1
        return sprintf(
114 1
            '<info>%s</info> version <comment>%s</comment> %s',
115 1
            $this->getName(),
116 1
            $this->getVersion(),
117 1
            CH::RELEASE_DATE
118
        );
119
    }
120
121
    /**
122
     * Prepend help with logo.
123
     *
124
     * @return string
125
     */
126 1
    public function getHelp()
127
    {
128 1
        return self::$logo . parent::getHelp();
129
    }
130
}
131