@@ -30,22 +30,22 @@ discard block |
||
30 | 30 | $this->components = $components; |
31 | 31 | } |
32 | 32 | |
33 | - public static function fromState(array $state){ |
|
34 | - $components=[]; |
|
33 | + public static function fromState(array $state) { |
|
34 | + $components = []; |
|
35 | 35 | |
36 | - foreach (ArrayHelper::getValue($state,'Components') as $componentState){ |
|
37 | - $kind=ArrayHelper::getValue($componentState,'kind'); |
|
38 | - $name=ArrayHelper::getValue($componentState,'name'); |
|
36 | + foreach (ArrayHelper::getValue($state, 'Components') as $componentState) { |
|
37 | + $kind = ArrayHelper::getValue($componentState, 'kind'); |
|
38 | + $name = ArrayHelper::getValue($componentState, 'name'); |
|
39 | 39 | |
40 | - $component=new AddressComponent($kind,$name); |
|
40 | + $component = new AddressComponent($kind, $name); |
|
41 | 41 | |
42 | - $components[$kind][]=$component; |
|
42 | + $components[$kind][] = $component; |
|
43 | 43 | } |
44 | 44 | |
45 | - $country_code=ArrayHelper::getValue($state,'country_code'); |
|
46 | - $formatted=ArrayHelper::getValue($state,'formatted'); |
|
45 | + $country_code = ArrayHelper::getValue($state, 'country_code'); |
|
46 | + $formatted = ArrayHelper::getValue($state, 'formatted'); |
|
47 | 47 | |
48 | - return new self($country_code,$formatted,$components); |
|
48 | + return new self($country_code, $formatted, $components); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
@@ -72,9 +72,9 @@ discard block |
||
72 | 72 | return $this->components; |
73 | 73 | } |
74 | 74 | |
75 | - public function getKindName($kind){ |
|
76 | - if(isset($this->components[$kind])){ |
|
77 | - $component=$this->components[$kind][count($this->components[$kind])-1]; |
|
75 | + public function getKindName($kind) { |
|
76 | + if (isset($this->components[$kind])) { |
|
77 | + $component = $this->components[$kind][count($this->components[$kind]) - 1]; |
|
78 | 78 | return $component->getName(); |
79 | 79 | } |
80 | 80 |