HangmanPlayerOptionsException::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 11
ccs 5
cts 5
cp 1
rs 9.4285
cc 1
eloc 9
nc 1
nop 5
crap 1
1
<?php
2
3
namespace Hangman\Exception;
4
5
use MiniGame\Entity\MiniGameId;
6
use MiniGame\Entity\PlayerId;
7
8
class HangmanPlayerOptionsException extends \Exception
9
{
10
    /**
11
     * @var PlayerId
12
     */
13
    private $playerId;
14
15
    /**
16
     * @var MiniGameId
17
     */
18
    private $miniGameId;
19
20
    /**
21
     * Constructor
22
     *
23
     * @param PlayerId   $playerId
24
     * @param MiniGameId $miniGameId
25
     * @param string     $message
26
     * @param int        $code
27
     * @param \Exception $previous
28
     */
29 6
    public function __construct(
30
        PlayerId $playerId,
31
        MiniGameId $miniGameId,
32
        $message = "",
33
        $code = 0,
34
        \Exception $previous = null
35
    ) {
36 6
        $this->playerId = $playerId;
37 6
        $this->miniGameId = $miniGameId;
38 6
        parent::__construct($message, $code, $previous);
39 6
    }
40
41
    /**
42
     * @return PlayerId
43
     */
44 3
    public function getPlayerId()
45
    {
46 3
        return $this->playerId;
47
    }
48
49
    /**
50
     * @return MiniGameId
51
     */
52 3
    public function getMiniGameId()
53
    {
54 3
        return $this->miniGameId;
55
    }
56
}
57