Completed
Push — master ( 5b2035...402cfe )
by Rémi
03:19
created

MiniGameMessageTextExtractor::extractMessage()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 8
ccs 4
cts 4
cp 1
rs 9.4285
cc 2
eloc 4
nc 2
nop 2
crap 2
1
<?php
2
3
namespace MiniGameMessageApp\Message;
4
5
use MessageApp\Message\TextExtractor\MessageTextExtractor;
6
use MiniGame\GameResult;
7
8
class MiniGameMessageTextExtractor implements MessageTextExtractor
9
{
10
    /**
11
     * Extract the message from the game result.
12
     *
13
     * @param  object $object
14
     * @param  string $languageIso
15
     * @return string
16
     */
17 6
    public function extractMessage($object, $languageIso)
18
    {
19 6
        if (!$object instanceof GameResult) {
20 3
            return null;
21
        }
22
23 3
        return $object->getAsMessage();
24
    }
25
}
26