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.

NewCommand::getEntity()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
dl 4
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Isolate\UnitOfWork\Command;
4
5
use Isolate\UnitOfWork\Exception\InvalidArgumentException;
6
7
/**
8
 * @api
9
 */
10 View Code Duplication
final class NewCommand implements Command
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
11
{
12
    /**
13
     * @var mixed
14
     */
15
    private $entity;
16
17
    /**
18
     * @param mixed $entity
19
     * @throws InvalidArgumentException
20
     */
21
    public function __construct($entity)
22
    {
23
        if (!is_object($entity)) {
24
            throw new InvalidArgumentException(sprintf("New command require object \"%s\" type passed.", gettype($entity)));
25
        }
26
27
        $this->entity = $entity;
28
    }
29
30
    /**
31
     * @return mixed
32
     * 
33
     * @api
34
     */
35
    public function getEntity()
36
    {
37
        return $this->entity;
38
    }
39
}
40