Test Failed
Push — master ( 42566f...6a7e8f )
by Paweł
03:20
created

PlayerIO::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 0
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AardsGerds\Game\Infrastructure\Cli;
6
7
use AardsGerds\Game\Event\Decision;
8
use AardsGerds\Game\Event\DecisionCollection;
9
use AardsGerds\Game\Player\PlayerAction;
10
use Symfony\Component\Console\Style\SymfonyStyle;
11
12
final class PlayerIO implements PlayerAction
13
{
14
    public function __construct(
15
        private SymfonyStyle $io,
16
    ) {}
17
18
    public function askForDecision(string $question, DecisionCollection $decisions): Decision
19
    {
20
        return $this->io->choice($question, $decisions->getItems());
21
    }
22
23
    public function askForInformation(string $question): int|string
24
    {
25
        return $this->io->ask($question);
26
    }
27
28
    public function askForConfirmation(string $question): bool
29
    {
30
        return $this->io->confirm($question);
31
    }
32
33
    public function note(string $message): void
34
    {
35
        $this->io->note($message);
36
    }
37
}
38