Application   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 42
c 0
b 0
f 0
wmc 4
lcom 0
cbo 3
ccs 0
cts 17
cp 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getLongVersion() 0 8 2
A getBaseProjectDirectory() 0 3 1
1
<?php
2
3
  namespace Funivan\Cs\Console;
4
5
  use Symfony\Component\Console\Application as BaseApplication;
6
7
8
  /**
9
   * @author Ivan Scherbak <[email protected]>
10
   */
11
  class Application extends BaseApplication {
12
13
    const VERSION = '0.0.1-alpha.1';
14
15
    /**
16
     * @var string
17
     */
18
    private $baseProjectDirectory;
19
20
21
    /**
22
     * @param string $baseProjectDirectory
23
     */
24
    public function __construct($baseProjectDirectory) {
25
      $this->baseProjectDirectory = $baseProjectDirectory;
26
      parent::__construct('PHP CS', self::VERSION);
27
      $this->add(new FixCommand());
28
      $this->add(new ReviewCommand());
29
    }
30
31
32
    /**
33
     * @return string
34
     */
35
    public function getLongVersion() {
36
      $version = parent::getLongVersion() . ' by <comment>Ivan Shcherbak</comment>';
37
      $commit = '@git-commit@';
38
      if ('@' . 'git-commit@' !== $commit) {
39
        $version .= ' (' . substr($commit, 0, 7) . ')';
40
      }
41
      return $version;
42
    }
43
44
45
    /**
46
     * @return string
47
     */
48
    public function getBaseProjectDirectory() {
49
      return $this->baseProjectDirectory;
50
    }
51
52
  }