Completed
Push — tests_improvements ( 8c6b99...667d50 )
by Vitaliy
04:19
created

Version   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 88.89%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
c 2
b 0
f 0
lcom 0
cbo 1
dl 0
loc 23
ccs 8
cts 9
cp 0.8889
rs 10

1 Method

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