ConfirmationProccessTrait::confirmationProcess()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
c 2
b 0
f 0
nc 2
nop 5
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, $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
}