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.

CurlExtensionCheck::getFailureMessage()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * This file is part of the Gerrie package.
4
 *
5
 * (c) Andreas Grunwald <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Gerrie\Check;
12
13
/**
14
 * Check if PHP extension "curl" is installed.
15
 *
16
 * @author Andreas Grunwald <[email protected]>
17
 */
18
class CurlExtensionCheck implements CheckInterface
19
{
20
    /**
21
     * Version of curl extension
22
     *
23
     * @var string
24
     */
25
    private $extensionVersion = '';
26
27
    /**
28
     * Executes the check itselfs
29
     *
30
     * @return boolean
31
     */
32 1
    public function check()
33
    {
34 1
        $extensionName = 'curl';
35 1
        $result = extension_loaded($extensionName);
36
37 1
        if ($result === true) {
38 1
            $curlVersion = curl_version();
39 1
            $this->extensionVersion = $curlVersion['version'];
40 1
        }
41
42 1
        return $result;
43
    }
44
45
    /**
46
     * Returns the message, if the check succeeded
47
     *
48
     * @return string
49
     */
50 1
    public function getSuccessMessage()
51
    {
52 1
        $message = 'PHP-Extension "curl" is installed and usable with "curl" in v%s.';
53 1
        $message = sprintf($message, $this->extensionVersion);
54 1
        return $message;
55
    }
56
57
    /**
58
     * Returns the message, if the check fails
59
     *
60
     * @return string
61
     */
62 1
    public function getFailureMessage()
63
    {
64 1
        $message = 'PHP-Extension "curl" is not installed. Please install PHP-Extension "curl".';
65 1
        return $message;
66
    }
67
68
    /**
69
     * Returns if this check is optional or required.
70
     *
71
     * @return bool
72
     */
73 1
    public function isOptional()
74
    {
75 1
        return false;
76
    }
77
}
78