MessageParserExceptionTextExtractor   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 17
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A extractMessage() 0 8 2
1
<?php
2
3
namespace MessageApp\Message\TextExtractor;
4
5
use MessageApp\Parser\Exception\MessageParserException;
6
use RemiSan\Intl\TranslatableResource;
7
8
class MessageParserExceptionTextExtractor implements MessageTextExtractor
9
{
10
    /**
11
     * Extract the message from the game result.
12
     *
13
     * @param  object $object
14
     * @return TranslatableResource
15
     */
16 6
    public function extractMessage($object)
17
    {
18 6
        if (!$object instanceof MessageParserException) {
19 3
            return null;
20
        }
21
22 3
        return new TranslatableResource($object->getCodeName());
23
    }
24
}
25