SaveToStorageMessage   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 21
ccs 0
cts 9
cp 0
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A word() 0 3 1
A __construct() 0 5 1
A language() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Dictionary\Features\PopulateStorage\SaveStorage\Message;
6
7
use App\Dictionary\Features\PopulateStorage\SaveStorage\Word;
8
9
/**
10
 * @psalm-immutable
11
 *
12
 * @see SaveToStorageMessageHandler
13
 */
14
final class SaveToStorageMessage
15
{
16
    private string $word;
17
    private string $language;
18
    private string $definition;
19
20
    public function __construct(string $word, string $definition, string $language)
21
    {
22
        $this->word = $word;
23
        $this->language = $language;
24
        $this->definition = $definition;
25
    }
26
27
    public function language(): string
28
    {
29
        return $this->language;
30
    }
31
32
    public function word(): Word
33
    {
34
        return new Word($this->word, $this->definition);
35
    }
36
}
37