Completed
Push — master ( 087020...368970 )
by
unknown
03:33
created

Version   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 80%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 19
ccs 4
cts 5
cp 0.8
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getVersion() 0 10 2
1
<?php
2
3
namespace Xsolla\SDK;
4
5
use Xsolla\SDK\Exception\XsollaException;
6
7
class Version
8
{
9
    const VERSION = 'v3.2.0';
10
11
    /**
12
     * @throws XsollaException
13
     * @return string
14
     */
15 29
    public static function getVersion()
16
    {
17 29
        if (!extension_loaded('curl')) {
18
            throw new XsollaException('The PHP cURL extension must be installed to use Xsolla SDK for PHP.');
19
        }
20
21 29
        $curlVersion = curl_version();
22
23 29
        return sprintf('xsolla-sdk-php/%s curl/%s PHP/%s', self::VERSION, $curlVersion['version'], PHP_VERSION);
24
    }
25
}
26