IdMessageReader   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 3
c 1
b 0
f 0
dl 0
loc 10
ccs 4
cts 4
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getMessages() 0 3 1
A getMessage() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Translator;
6
7
use RuntimeException;
8
9
/**
10
 * ID message reader returns ID as message and doesn't support getting all messages at once.
11
 */
12
final class IdMessageReader implements MessageReaderInterface
13
{
14 1
    public function getMessage(string $id, string $category, string $locale, array $parameters = []): string
15
    {
16 1
        return $id;
17
    }
18
19 1
    public function getMessages(string $category, string $locale): array
20
    {
21 1
        throw new RuntimeException('IdMessageReader doesn\'t support getting all messages at once.');
22
    }
23
}
24