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 ( fd00ec...b10e46 )
by Christian
79:20 queued 20:27
created

Sitemap::getId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * (c) Christian Gripp <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Core23\SitemapBundle\Model;
13
14
class Sitemap implements SitemapInterface
15
{
16
    /**
17
     * @var array
18
     */
19
    protected $settings;
20
21
    /**
22
     * @var string|null
23
     */
24
    protected $type;
25
26
    /**
27
     * @var int
28
     */
29
    protected $ttl = 0;
30
31
    /**
32
     * @param string $type
33
     * @param array  $settings
34
     */
35
    public function __construct(string $type, array $settings = [])
36
    {
37
        $this->settings = $settings;
38
        $this->type     = $type;
39
    }
40
41
    /**
42
     * {@inheritdoc}
43
     */
44
    public function __toString()
45
    {
46
        return $this->getType() ?: 'n/a';
47
    }
48
49
    /**
50
     * {@inheritdoc}
51
     */
52
    public function getType(): string
53
    {
54
        return $this->type;
55
    }
56
57
    /**
58
     * {@inheritdoc}
59
     */
60
    public function setSettings(array $settings = []): void
61
    {
62
        $this->settings = $settings;
63
    }
64
65
    /**
66
     * {@inheritdoc}
67
     */
68
    public function getSettings(): array
69
    {
70
        return $this->settings;
71
    }
72
73
    /**
74
     * {@inheritdoc}
75
     */
76
    public function getSetting(string $name, $default = null)
77
    {
78
        return $this->settings[$name] ?? $default;
79
    }
80
81
    /**
82
     * {@inheritdoc}
83
     */
84
    public function getTtl(): int
85
    {
86
        if (!$this->getSetting('use_cache', true)) {
87
            return 0;
88
        }
89
90
        $ttl = $this->getSetting('ttl', 86400);
91
92
        $this->ttl = $ttl;
93
94
        return $this->ttl;
95
    }
96
}
97