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 ( 1e6437...ac5983 )
by Odiseo
10:05
created

ArticleComment   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 4
eloc 7
c 1
b 0
f 1
dl 0
loc 31
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setAuthor() 0 3 1
A getAuthor() 0 3 1
A getUsername() 0 7 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Odiseo\SyliusBlogPlugin\Model;
6
7
use Sylius\Component\Core\Model\ShopUserInterface;
8
use Odiseo\BlogBundle\Model\ArticleComment as BaseArticleComment;
9
10
/**
11
 * @author Diego D'amico <[email protected]>
12
 */
13
class ArticleComment extends BaseArticleComment implements ArticleCommentInterface
14
{
15
    /** @var ShopUserInterface|null */
16
    protected $author;
17
18
    /**
19
     * {@inheritdoc}
20
     */
21
    public function getAuthor(): ?ShopUserInterface
22
    {
23
        return $this->author;
24
    }
25
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function setAuthor(?ShopUserInterface $author): void
30
    {
31
        $this->author = $author;
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37
    public function getUsername()
38
    {
39
        if($this->getAuthor()) {
40
            return $this->getAuthor()->getUsername();
41
        }
42
43
        return $this->getEmail();
44
    }
45
}
46