CreatePlayerCommand   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 42
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getCommandName() 0 4 1
A create() 0 11 1
1
<?php
2
3
namespace MiniGameApp\Command;
4
5
use MiniGame\Entity\MiniGameId;
6
use MiniGame\Entity\PlayerId;
7
use RemiSan\Context\Context;
8
9
class CreatePlayerCommand extends AbstractPlayerCommand
10
{
11
    const NAME = 'PLAYER.CREATE';
12
13
    /**
14
     * Construct.
15
     */
16 3
    public function __construct()
17
    {
18 3
    }
19
20
    /**
21
     * Returns the command name
22
     *
23
     * @return string
24
     */
25 3
    public function getCommandName()
26
    {
27 3
        return self::NAME;
28
    }
29
30
    /**
31
     * Construct
32
     *
33
     * @param MiniGameId  $id
34
     * @param PlayerId    $playerId
35
     * @param Context      $origin
36
     *
37
     * @return CreatePlayerCommand
38
     */
39 3
    public static function create(
40
        MiniGameId $id,
41
        PlayerId $playerId,
42
        Context $origin = null
43
    ) {
44 3
        $obj = new self();
45
46 3
        $obj->init($id, $playerId, $origin);
47
48 3
        return $obj;
49
    }
50
}
51