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.
Passed
Push — master ( cef56e...440f86 )
by
unknown
05:14
created

BlogExtension   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 35
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 35
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getName() 0 3 1
A getDisqusShortname() 0 3 1
A getFunctions() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Odiseo\SyliusBlogPlugin\Twig;
6
7
use Twig\Extension\AbstractExtension;
8
use Twig\TwigFunction;
9
10
final class BlogExtension extends AbstractExtension
11
{
12
    /** @var string|null */
13
    private $disqusShortname;
14
15
    public function __construct(
16
        ?string $disqusShortname
17
    ) {
18
        $this->disqusShortname = $disqusShortname;
19
    }
20
21
    /**
22
     * @return array|TwigFunction[]
23
     */
24
    public function getFunctions(): array
25
    {
26
        return [
27
            new TwigFunction('disqus_shortname', [$this, 'getDisqusShortname'])
28
        ];
29
    }
30
31
    /**
32
     * @return string|null
33
     */
34
    public function getDisqusShortname(): ?string
35
    {
36
        return $this->disqusShortname;
37
    }
38
39
    /**
40
     * @return string
41
     */
42
    public function getName(): string
43
    {
44
        return 'blog';
45
    }
46
}
47