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
Pull Request — master (#37)
by
unknown
02:36
created

Chartblocks::fakeResponse()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 13
ccs 0
cts 9
cp 0
rs 9.4285
cc 1
eloc 9
nc 1
nop 0
crap 2
1
<?php
2
/**
3
 * Chartblocks.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 chartblocks.com Provider
17
 */
18
class Chartblocks extends \Embera\Adapters\Service
19
{
20
    /** inline {@inheritdoc} */
21
    protected $apiUrl = 'http://embed.chartblocks.com/1.0/oembed?format=json';
22
23
    /** inline {@inheritdoc} */
24 2
    protected function validateUrl()
25
    {
26 2
        $this->url->convertToHttp();
27 2
        return (preg_match('~chartblocks\.com/c/([^ ]+)/?$~i', $this->url));
28
    }
29
30
    /** inline {@inheritdoc} */
31
    public function fakeResponse()
32
    {
33
        preg_match('~chartblocks\.com/c/([0-9A-z]+)~i', $this->url, $m);
34
35
        return array(
36
            'type' => 'rich',
37
            'provider_name' => 'ChartBlocks',
38
            'provider_url' => 'http://www.chartblocks.com',
39
            'title' => 'Unknown title',
40
            'thumbnail_url' => 'https://d3ugvbs94d921r.cloudfront.net/' . $m['1'] . '.png',
41
            'html' => '<iframe class="chartblocks-embed" src="//embed.chartblocks.com/1.0/?c=' . $m['1'] . '" height="{height}" width="{width}" frameborder="0"></iframe>',
42
        );
43
    }
44
}
45
46
?>
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...
47