Address::getCity()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file has been created by developers from BitBag.
5
 * Feel free to contact us once you face any issues or want to start
6
 * another great project.
7
 * You can find more information about us on https://bitbag.io and write us
8
 * an email on [email protected].
9
 */
10
11
declare(strict_types=1);
12
13
namespace BitBag\SyliusVueStorefrontPlugin\Model\Request\Common;
14
15
class Address
16
{
17
    /** @var int */
18
    public $id;
19
20
    /** @var int|null */
21
    public $customer_id;
22
23
    /** @var int */
24
    public $region_id;
25
26
    /** @var string */
27
    public $region_code;
28
29
    /** @var string */
30
    public $country_id;
31
32
    /** @var string[] */
33
    public $street;
34
35
    /** @var string */
36
    public $company;
37
38
    /** @var string|null */
39
    public $telephone;
40
41
    /** @var string */
42
    public $postcode;
43
44
    /** @var string */
45
    public $city;
46
47
    /** @var string */
48
    public $firstname;
49
50
    /** @var string */
51
    public $lastname;
52
53
    /** @var string|null */
54
    public $vat_id;
55
56
    /** workaround for /cart/shipping-information case inconsistency in vsf */
57
    public $countryId;
58
59
    public function getCountryId(): string
60
    {
61
        return $this->country_id ?? $this->countryId;
62
    }
63
64
    public function getStreet(): ?string
65
    {
66
        if (!$this->street) {
67
            return null;
68
        }
69
70
        return \implode(' ', $this->street);
71
    }
72
73
    public function getPostcode(): ?string
74
    {
75
        return $this->postcode;
76
    }
77
78
    public function getCity(): ?string
79
    {
80
        return $this->city;
81
    }
82
83
    public function getFirstName(): string
84
    {
85
        return $this->firstname;
86
    }
87
88
    public function getLastName(): string
89
    {
90
        return $this->lastname;
91
    }
92
}
93