Completed
Pull Request — master (#17)
by
unknown
01:17
created

Factory   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 3
dl 0
loc 26
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A createDataProvider() 0 4 1
A createData() 0 4 1
A createGuzzleClient() 0 4 1
A createBodyFactory() 0 4 1
1
<?php declare(strict_types=1);
2
3
namespace h4kuna\Ares;
4
5
use GuzzleHttp;
6
7
class Factory implements IFactory
8
{
9
10
	public function createDataProvider(): DataProvider
11
	{
12
		return new DataProvider($this);
13
	}
14
15
16
	public function createData(array $data): Data
17
	{
18
		return new Data($data);
19
	}
20
21
22
	public function createGuzzleClient(array $options = [CURLOPT_CONNECTTIMEOUT => 30]): GuzzleHttp\Client
23
	{
24
		return new GuzzleHttp\Client(['curl' => $options, 'headers' => ['X-Powered-By' => 'h4kuna/ares']]);
25
	}
26
27
	public function createBodyFactory(): BodyFactory
28
	{
29
		return new BodyFactory();
30
	}
31
32
}
33