Passed
Push — main ( ed779b...d01439 )
by Nils
05:39 queued 02:41
created

Answer::getCommand()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Startwind\Forrest\Command\Answer;
4
5
use Startwind\Forrest\Command\Command;
6
use Startwind\Forrest\Command\CommandFactory;
7
8
class Answer
9
{
10
    private Command $command;
11
    private string $question;
12
    private string $answer;
13
14
    public function __construct(string $prompt, string $question, string $answer)
15
    {
16
        $this->command = CommandFactory::fromArray([
17
            CommandFactory::CONFIG_FIELD_NAME => 'forrest-ai',
18
            CommandFactory::CONFIG_FIELD_DESCRIPTION => 'Answer to: ' . $question,
19
            CommandFactory::CONFIG_FIELD_PROMPT => $prompt
20
        ]);
21
22
        $this->question = $question;
23
        $this->answer = $answer;
24
    }
25
26
    public function getCommand(): Command
27
    {
28
        return $this->command;
29
    }
30
31
    public function getQuestion(): string
32
    {
33
        return $this->question;
34
    }
35
36
    public function getAnswer(): string
37
    {
38
        return $this->answer;
39
    }
40
}
41