MissingTranslationEvent   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
eloc 4
c 0
b 0
f 0
dl 0
loc 33
ccs 8
cts 8
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 2 1
A getLanguage() 0 3 1
A getMessage() 0 3 1
A getCategory() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Translator\Event;
6
7
/**
8
 * The event is thrown when translation is missing.
9
 */
10
final class MissingTranslationEvent
11
{
12
    /**
13
     * @param string $category Category of the missing translation.
14
     * @param string $language Language of the missing translation.
15
     * @param string $message Message of the missing translation.
16
     */
17 13
    public function __construct(private string $category, private string $language, private string $message)
18
    {
19 13
    }
20
21
    /**
22
     * @return string Category of the missing translation.
23
     */
24 1
    public function getCategory(): string
25
    {
26 1
        return $this->category;
27
    }
28
29
    /**
30
     * @return string Language of the missing translation.
31
     */
32 1
    public function getLanguage(): string
33
    {
34 1
        return $this->language;
35
    }
36
37
    /**
38
     * @return string Message of the missing translation.
39
     */
40 1
    public function getMessage(): string
41
    {
42 1
        return $this->message;
43
    }
44
}
45