AbstractGameCommand::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 4
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