Completed
Push — master ( 4fb6aa...066340 )
by juan
02:57
created

ConfirmationProccessTrait::confirmationProcess()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
c 1
b 0
f 0
nc 2
nop 4
dl 0
loc 7
rs 9.4285
1
<?php
2
3
namespace Juanber84\Console\Command;
4
5
use Symfony\Component\Console\Question\ConfirmationQuestion;
6
7
trait ConfirmationProccessTrait
8
{
9
    public function confirmationProcess($input, $output, $helper, $message)
10
    {
11
        $question = new ConfirmationQuestion('Continue with this action? <info>Y/n</info> ', true);
12
        if (!$helper->ask($input, $output, $question)) {
13
            return $output->writeln("<fg=blue;>".$message.'</>');
14
        }
15
    }
16
}