Completed
Push — master ( c41cde...220efb )
by Rémi
02:56
created

UserCreatedEventTextExtractor   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
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\Event\UserCreatedEvent;
6
use RemiSan\Intl\TranslatableResource;
7
8
class UserCreatedEventTextExtractor 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 UserCreatedEvent) {
19 3
            return null;
20
        }
21
22 3
        return new TranslatableResource('user.created');
23
    }
24
}
25