GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

EditCommand::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
c 0
b 0
f 0
rs 9.6666
cc 2
eloc 5
nc 2
nop 2
1
<?php
2
3
namespace Isolate\UnitOfWork\Command;
4
5
use Isolate\UnitOfWork\Entity\Value\ChangeSet;
6
use Isolate\UnitOfWork\Exception\InvalidArgumentException;
7
8
/**
9
 * @api
10
 */
11
final class EditCommand implements Command
12
{
13
    /**
14
     * @var mixed
15
     */
16
    private $entity;
17
18
    /**
19
     * @var ChangeSet
20
     */
21
    private $changeSet;
22
23
    /**
24
     * @param mixed $entity
25
     * @param ChangeSet $changeSet
26
     * @throws InvalidArgumentException
27
     */
28
    public function __construct($entity, ChangeSet $changeSet)
29
    {
30
        if (!is_object($entity)) {
31
            throw new InvalidArgumentException(sprintf("Edit command require object \"%s\" type passed.", gettype($entity)));
32
        }
33
34
        $this->entity = $entity;
35
        $this->changeSet = $changeSet;
36
    }
37
38
    /**
39
     * @return mixed
40
     * 
41
     * @api
42
     */
43
    public function getEntity()
44
    {
45
        return $this->entity;
46
    }
47
48
    /**
49
     * @return ChangeSet
50
     * 
51
     * @api
52
     */
53
    public function getChanges()
54
    {
55
        return $this->changeSet;
56
    }
57
}
58