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 ( 3612e9...58a54a )
by Michael
04:00
created

Didacte   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
c 1
b 0
f 1
lcom 1
cbo 1
dl 0
loc 18
ccs 0
cts 5
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A validateUrl() 0 11 3
1
<?php
2
/**
3
 * Didacte.php
4
 *
5
 * @package Providers
6
 * @author Michael Pratt <[email protected]>
7
 * @link   http://www.michael-pratt.com/
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
namespace Embera\Providers;
14
15
/**
16
 * The didacte.com Provider
17
 * @link http://didacte.com
18
 */
19
class Didacte extends \Embera\Adapters\Service
20
{
21
    /** inline {@inheritdoc} */
22
    protected $apiUrl = 'https://{m}.didacte.com/cards/oembed?format=json';
23
24
    /** inline {@inheritdoc} */
25
    protected function validateUrl()
26
    {
27
28
        if (preg_match('~didacte\.com/a/course/(:?[^ ]+)$~i', $this->url) && preg_match('~([^ ]+)\.didacte\.com/a/course/~i', $this->url, $m)) {
29
            // We need the subdomain for the oembed endpoint
30
            $this->apiUrl = str_replace('{m}', $m['1'], $this->apiUrl);
31
            return true;
32
        }
33
34
        return false;
35
    }
36
}
37
38
?>
0 ignored issues
show
Best Practice introduced by
It is not recommended to use PHP's closing tag ?> in files other than templates.

Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.

A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.

Loading history...
39