Completed
Push — master ( 5feeae...0d739f )
by Josh
18:19 queued 12:34
created

Http::getClient()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 2
eloc 2
nc 2
nop 0
crap 2
1
<?php
2
3
/**
4
* @package   s9e\TextFormatter
5
* @copyright Copyright (c) 2010-2016 The s9e Authors
6
* @license   http://www.opensource.org/licenses/mit-license.php The MIT License
7
*/
8
namespace s9e\TextFormatter\Utils;
9
10
use s9e\TextFormatter\Utils\Http\Clients\Curl;
11
use s9e\TextFormatter\Utils\Http\Clients\Native;
12
13
abstract class Http
14
{
15
	/**
16
	* Instantiate and return an HTTP client
17
	*
18
	* @return Http\Client
19
	*/
20 1
	public static function getClient()
21
	{
22 1
		return (extension_loaded('curl')) ? new Curl : new Native;
23
	}
24
}