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.

Yandex::normalizeUrl()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 8
ccs 0
cts 6
cp 0
rs 9.4285
c 1
b 0
f 0
cc 2
eloc 4
nc 2
nop 0
crap 6
1
<?php
2
/**
3
 * Yandex.php
4
 *
5
 * @package Providers
6
 * @author dotzero <[email protected]>
7
 * @link   http://www.dotzero.ru/
8
 */
9
10
namespace Embera\Providers;
11
12
/**
13
 * The Yandex.ru Provider
14
 */
15
class Yandex extends \Embera\Adapters\Service
16
{
17
    /** inline {@inheritdoc} */
18
    protected $apiUrl = 'http://video.yandex.ru/oembed.json';
19
20
    /** inline {@inheritdoc} */
21
    protected function validateUrl()
22
    {
23
        $this->url->stripQueryString();
24
25
        return (preg_match('~\/users\/([a-zA-Z0-9\_\.-]+)\/view\/([0-9]+)~i', $this->url));
26
    }
27
28
    /** inline {@inheritdoc} */
29
    protected function normalizeUrl()
30
    {
31
        $this->url->stripQueryString();
32
33
        if (preg_match('~\/users\/([a-zA-Z0-9\_\.-]+)\/view\/([0-9]+)~i', $this->url, $matches)) {
34
            $this->url = new \Embera\Url('http://video.yandex.ru/users/' . $matches['1'] . '/view/' . $matches['2'] . '/');
35
        }
36
    }
37
}
38