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 ( a31460...f22c5a )
by Michael
05:43
created

Mathembed::validateUrl()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 7
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
/**
3
 * Mathembed.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 mathembed.com Provider
17
 * @link http://www.mathembed.com
18
 * @TODO: Might support fake response
19
 */
20
class Mathembed extends \Embera\Adapters\Service
21
{
22
    /** inline {@inheritdoc} */
23
    protected $apiUrl = 'https://mathembed.com/oembed?format=json';
24
25
    /** inline {@inheritdoc} */
26
    protected function validateUrl()
27
    {
28
        $this->url->convertToHttps();
29
        $this->url->stripWWW();
30
31
        return preg_match('~/latex\?inputText=(?:[^ ]+)$~i', $this->url);
32
    }
33
}
34
35
?>
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...
36