GithubCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 25
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A showErrorRunLlumInitFirst() 0 6 1
A showMessageRunningCommand() 0 3 1
1
<?php
2
3
namespace Acacha\Llum\Console;
4
5
use Symfony\Component\Console\Output\OutputInterface;
6
7
/**
8
 * Class GithubCommand.
9
 *
10
 * @package Acacha\Llum\Console
11
 */
12
trait GithubCommand
13
{
14
15
    /**
16
     * Show error run llum init first.
17
     *
18
     * @param OutputInterface $output
19
     * @param $varname
20
     */
21
    protected function showErrorRunLlumInitFirst(OutputInterface $output, $varname)
22
    {
23
        $output->writeln('<error>' . $varname
24
            . ' not found in config file. Run git init before executing this command!</error>');
25
        die();
0 ignored issues
show
Coding Style Compatibility introduced by
The method showErrorRunLlumInitFirst() contains an exit expression.

An exit expression should only be used in rare cases. For example, if you write a short command line script.

In most cases however, using an exit expression makes the code untestable and often causes incompatibilities with other libraries. Thus, unless you are absolutely sure it is required here, we recommend to refactor your code to avoid its usage.

Loading history...
26
    }
27
28
    /**
29
     * Show message running command.
30
     *
31
     * @param OutputInterface $output
32
     */
33
    protected function showMessageRunningCommand(OutputInterface $output, $commandName) {
34
        $output->writeln('<info>Running command ' . $commandName . '...</info>');
35
    }
36
}