Config   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 40
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A make() 0 4 1
A __construct() 0 4 1
A setDefaults() 0 6 1
A toArray() 0 4 1
1
<?php
2
3
namespace Gemz\HttpClient;
4
5
use Gemz\HttpClient\Contracts\Options;
6
7
class Config
8
{
9
    use Options;
10
11
    /**
12
     * @return Config
13
     */
14
    public static function make()
15
    {
16
        return new self();
17
    }
18
19
    /**
20
     * Config constructor
21
     */
22
    public function __construct()
23
    {
24
        $this->setDefaults();
25
    }
26
27
    /**
28
     * @return $this
29
     */
30
    protected function setDefaults(): self
31
    {
32
        $this->asJson();
33
34
        return $this;
35
    }
36
37
    /**
38
     * Config as array
39
     *
40
     * @return array<mixed>
41
     */
42
    public function toArray(): array
43
    {
44
        return $this->options;
45
    }
46
}
47