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.

WordPressUrlGenerator::supports()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
/*
4
 * This file is part of the composer-changelogs project.
5
 *
6
 * (c) Loïck Piera <[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 Pyrech\ComposerChangelogs\UrlGenerator;
13
14
use Pyrech\ComposerChangelogs\Version;
15
16
/**
17
 * @author Sullivan Senechal <[email protected]>
18
 */
19
class WordPressUrlGenerator implements UrlGenerator
20
{
21
    const DOMAIN = 'svn.wordpress.org';
22
23
    /**
24
     * {@inheritdoc}
25
     */
26 4
    public function supports($sourceUrl)
27
    {
28 4
        return strpos($sourceUrl, self::DOMAIN) !== false;
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34 2
    public function generateCompareUrl($sourceUrlFrom, Version $versionFrom, $sourceUrlTo, Version $versionTo)
35
    {
36 2
        if (preg_match('#plugins.svn.wordpress.org/(.*)/#', $sourceUrlTo, $matches)) {
37 2
            $plugin = $matches[1];
38
39 2
            return sprintf('https://wordpress.org/plugins/%s/changelog/', $plugin);
40
        }
41
42 2
        if (preg_match('#themes.svn.wordpress.org/(.*)/#', $sourceUrlTo, $matches)) {
43 2
            $theme = $matches[1];
44
45 2
            return sprintf('https://themes.trac.wordpress.org/log/%s/', $theme);
46
        }
47
48
        return false;
49
    }
50
51
    /**
52
     * {@inheritdoc}
53
     */
54 2
    public function generateReleaseUrl($sourceUrl, Version $version)
55
    {
56 2
        return false;
57
    }
58
}
59