Completed
Push — master ( 1c0bf9...10779d )
by juan
02:27
created

NameProjectTrait::getNameOfProject()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 3
eloc 7
c 1
b 1
f 0
nc 2
nop 4
dl 0
loc 11
rs 9.4285
1
<?php
2
3
namespace Juanber84\Console\Command;
4
5
use Symfony\Component\Console\Question\Question;
6
7
trait NameProjectTrait
8
{
9
    private function getNameOfProject($input, $output, $helper, $nameOfProject)
10
    {
11
        if (!$nameOfProject) {
12
            $question = new Question('<question>What is the project key?</question>: ');
13
            do {
14
                $nameOfProject = trim($helper->ask($input, $output, $question));
15
            } while (empty($nameOfProject));
16
        }
17
18
        return $nameOfProject;
19
    }
20
21
}