Completed
Push — master ( d40022...a8a6e5 )
by Arne
01:50
created

Style   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A askMultiple() 0 11 2
1
<?php
2
3
namespace Archivr\Cli;
4
5
use Symfony\Component\Console\Style\SymfonyStyle;
6
7
class Style extends SymfonyStyle
8
{
9
    /**
10
     * Asks the same question multiple times returning the answers as an array.
11
     *
12
     * @param string $question
13
     * @param callable $validator
14
     * @return array
15
     */
16
    public function askMultiple(string $question, callable $validator = null): array
17
    {
18
        $answers = [];
19
20
        while ($answer = $this->ask($question, null, $validator)) {
21
22
            $answers[] = $answer;
23
        }
24
25
        return $answers;
26
    }
27
}
28