Completed
Push — master ( c6e3b5...fd2349 )
by Milan
15:04 queued 10s
created

Factory   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 3
dl 0
loc 27
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
28
	public function createBodyFactory(): BodyFactory
29
	{
30
		return new BodyFactory();
31
	}
32
33
}
34