ConfirmationProccessTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A confirmationProcess() 0 7 2
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, $messageQuestion = 'Continue with this action? <info>Y/n</info> ')
10
    {
11
        $question = new ConfirmationQuestion($messageQuestion, true);
12
        if (!$helper->ask($input, $output, $question)) {
13
            return $output->writeln("<fg=blue;>".$message.'</>');
14
        }
15
    }
16
}