Completed
Push — master ( 48d08f...c4e0a9 )
by Josh
28:01
created

OnlineMinifier::getHttpClient()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 9
rs 9.6667
c 1
b 0
f 1
ccs 6
cts 6
cp 1
cc 2
eloc 4
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\Configurator\JavaScript;
9
10
use s9e\TextFormatter\Configurator\Helpers\Http;
11
12
abstract class OnlineMinifier extends Minifier
13
{
14
	/**
15
	* @var \s9e\TextFormatter\Configurator\Helpers\Http\Client Client used to perform HTTP request
16
	*/
17
	public $client;
18
19
	/**
20
	* @var integer Timeout in seconds
21
	*/
22
	public $timeout = 10;
23
24
	/**
25
	* Return a cached instance of the HTTP client
26
	*
27
	* @return \s9e\TextFormatter\Configurator\Helpers\Http\Client
28
	*/
29 8
	protected function getHttpClient()
30
	{
31 8
		if (!isset($this->client))
32 8
		{
33 1
			$this->client = Http::getClient();
34 1
		}
35
36 8
		return $this->client;
37
	}
38
}