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.
Completed
Push — master ( a7d97d...0097ae )
by Андрей
02:25
created

HistoryStep   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 57
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 4
c 3
b 0
f 0
lcom 1
cbo 3
dl 0
loc 57
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 16 1
A getEntry() 0 4 1
A setEntry() 0 10 2
1
<?php
2
/**
3
 * @link    https://github.com/old-town/workflow-doctrine
4
 * @author  Malofeykin Andrey  <[email protected]>
5
 */
6
namespace OldTown\Workflow\Spi\Doctrine\Entity;
7
8
use Doctrine\ORM\Mapping as ORM;
9
10
11
/**
12
 * Class HistoryStep
13
 *
14
 * @package OldTown\Workflow\Spi\Doctrine\Entity
15
 *
16
 * @ORM\Entity(repositoryClass="\OldTown\Workflow\Spi\Doctrine\EntityRepository\StepRepository")
17
 */
18
class HistoryStep extends AbstractStep implements HistoryStepInterface
19
{
20
    /**
21
     * @ORM\ManyToOne(targetEntity="AbstractEntry", inversedBy="historySteps")
22
     * @ORM\JoinColumn(name="entry_id", referencedColumnName="id")
23
     *
24
     * @var EntryInterface
25
     *
26
     */
27
    protected $entry;
28
29
    /**
30
     * @param CurrentStepInterface $step
31
     *
32
     * @throws Exception\InvalidArgumentException
33
     */
34
    public function __construct(CurrentStepInterface $step)
35
    {
36
        parent::__construct();
37
38
        $this->setId($step->getId());
39
        $this->setActionId($step->getActionId());
40
        $this->setCaller($step->getCaller());
41
        $this->setStatus($step->getStatus());
42
        $this->setFinishDate($step->getFinishDate());
43
        $this->setDueDate($step->getDueDate());
44
        $this->setEntry($step->getEntry());
45
        $this->setOwner($step->getOwner());
46
        $this->setStartDate($step->getStartDate());
47
        $this->setStepId($step->getStepId());
48
        $this->setPreviousSteps($step->getPreviousSteps());
49
    }
50
51
    /**
52
     * @return EntryInterface
53
     */
54
    public function getEntry()
55
    {
56
        return $this->entry;
57
    }
58
59
    /**
60
     * @param EntryInterface $entry
61
     *
62
     * @return $this
63
     */
64
    public function setEntry(EntryInterface $entry)
65
    {
66
        $this->entry = $entry;
67
68
        if (!$entry->getHistorySteps()->contains($this)) {
69
            $entry->getHistorySteps()->add($this);
70
        }
71
72
        return $this;
73
    }
74
}
75