Passed
Push — master ( f4ebb6...c31285 )
by Gaël
11:14
created

AddressResource   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 34
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setOptionalField() 0 3 1
A __construct() 0 11 1
1
<?php
2
3
namespace DansMaCulotte\Monetico\Resources;
4
5
class AddressResource
6
{
7
    /** @var array */
8
    public $data = [];
9
10
    /**
11
     * Client constructor.
12
     *
13
     * @param string $addressLine
14
     * @param string $city
15
     * @param string $postalCode
16
     * @param string $country
17
     */
18
    public function __construct(
19
        string $addressLine,
20
        string $city,
21
        string $postalCode,
22
        string $country
23
    ) {
24
        $this->data = [
25
            'addressLine1' => $addressLine,
26
            'city' => $city,
27
            'postalCode' => $postalCode,
28
            'country' => $country,
29
        ];
30
    }
31
32
    /**
33
     * @param string $name
34
     * @param string $value
35
     */
36
    public function setOptionalField(string $name, string $value): void
37
    {
38
        $this->data[$name] = $value;
39
    }
40
}
41