UnableToCreateUserEventTextExtractor   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A extractMessage() 0 8 2
1
<?php
2
3
namespace MessageApp\Message\TextExtractor;
4
5
use MessageApp\Event\UnableToCreateUserEvent;
6
use RemiSan\Intl\TranslatableResource;
7
8
class UnableToCreateUserEventTextExtractor implements MessageTextExtractor
9
{
10
    const MESSAGE_KEY = 'user.created.failed';
11
12
    /**
13
     * Extract the message from the game result.
14
     *
15
     * @param  object $object
16
     * @return TranslatableResource
17
     */
18 6
    public function extractMessage($object)
19
    {
20 6
        if (!$object instanceof UnableToCreateUserEvent) {
21 3
            return null;
22
        }
23
24 3
        return new TranslatableResource(self::MESSAGE_KEY);
25
    }
26
}
27