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

AddressResource::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
nc 1
nop 4
dl 0
loc 11
rs 10
c 1
b 0
f 0
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