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.

StaticSitemapService::execute()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
cc 2
nc 2
nop 1
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\Sitemap;
13
14
use Core23\SitemapBundle\Definition\SitemapDefinitionInterface;
15
use Core23\SitemapBundle\Model\Url;
16
use Symfony\Component\OptionsResolver\OptionsResolver;
17
18
final class StaticSitemapService implements SitemapServiceInterface
19
{
20
    public function configureSettings(OptionsResolver $resolver): void
21
    {
22
        $resolver
23
            ->setDefaults([
24
                'priority'   => null,
25
                'url'        => null,
26
                'changefreq' => null,
27
            ])
28
            ->setAllowedTypes('priority', ['null', 'int'])
29
        ;
30
    }
31
32
    public function execute(SitemapDefinitionInterface $sitemap): array
33
    {
34
        if (null === $sitemap->getSetting('url')) {
35
            return [];
36
        }
37
38
        return [
39
            new Url($sitemap->getSetting('url'), $sitemap->getSetting('priority'), $sitemap->getSetting('changefreq')),
40
        ];
41
    }
42
}
43