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 ( aea427...e2243d )
by
unknown
09:11
created

Article   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 64
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 9
eloc 13
c 0
b 0
f 0
dl 0
loc 64
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A setAuthor() 0 3 1
A hasChannel() 0 3 1
A getChannels() 0 3 1
A addChannel() 0 4 2
A removeChannel() 0 4 2
A getAuthor() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Odiseo\SyliusBlogPlugin\Entity;
6
7
use Doctrine\Common\Collections\ArrayCollection;
8
use Doctrine\Common\Collections\Collection;
9
use Odiseo\BlogBundle\Model\Article as BaseArticle;
10
use Sylius\Component\Channel\Model\ChannelInterface;
11
use Sylius\Component\Core\Model\AdminUserInterface;
12
13
class Article extends BaseArticle implements ArticleInterface
14
{
15
    /** @var AdminUserInterface|null */
16
    private $author;
17
18
    /** @var Collection|ChannelInterface[] */
19
    private $channels;
20
21
    public function __construct()
22
    {
23
        parent::__construct();
24
25
        $this->channels = new ArrayCollection();
26
    }
27
28
    /**
29
     * @inheritdoc
30
     */
31
    public function getAuthor(): ?AdminUserInterface
32
    {
33
        return $this->author;
34
    }
35
36
    /**
37
     * @inheritdoc
38
     */
39
    public function setAuthor(?AdminUserInterface $author): void
40
    {
41
        $this->author = $author;
42
    }
43
44
    /**
45
     * @inheritdoc
46
     */
47
    public function getChannels(): Collection
48
    {
49
        return $this->channels;
50
    }
51
52
    /**
53
     * @inheritdoc
54
     */
55
    public function hasChannel(ChannelInterface $channel): bool
56
    {
57
        return $this->channels->contains($channel);
58
    }
59
60
    /**
61
     * @inheritdoc
62
     */
63
    public function addChannel(ChannelInterface $channel): void
64
    {
65
        if (!$this->hasChannel($channel)) {
66
            $this->channels->add($channel);
67
        }
68
    }
69
70
    /**
71
     * @inheritdoc
72
     */
73
    public function removeChannel(ChannelInterface $channel): void
74
    {
75
        if ($this->hasChannel($channel)) {
76
            $this->channels->removeElement($channel);
77
        }
78
    }
79
}
80