AbstractGameCommand   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 31
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
execute() 0 1 ?
1
<?php
2
3
namespace Rottenwood\KingdomBundle\Command\Infrastructure;
4
5
use Rottenwood\KingdomBundle\Entity\Infrastructure\User;
6
use Symfony\Component\DependencyInjection\ContainerInterface;
7
8
abstract class AbstractGameCommand implements GameCommandInterface
9
{
10
11
    /** @var User */
12
    protected $user;
13
    /** @var string */
14
    protected $parameters;
15
    /** @var ContainerInterface */
16
    protected $container;
17
    /** @var CommandResponse */
18
    protected $result;
19
20
    /**
21
     * @param User               $user
22
     * @param string             $commandName
23
     * @param string             $parameters
24
     * @param ContainerInterface $container
25
     */
26
    public function __construct(User $user, $commandName, $parameters, ContainerInterface $container)
27
    {
28
        $this->user = $user;
29
        $this->parameters = $parameters;
30
        $this->container = $container;
31
        $this->result = new CommandResponse($commandName);
32
    }
33
34
    /**
35
     * {@inheritDoc}
36
     */
37
    abstract public function execute(): CommandResponse;
38
}
39