Completed
Push — master ( 37d52e...ca4941 )
by Jhao
11:04
created

NormalizedFio   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 7
eloc 12
c 1
b 0
f 0
dl 0
loc 46
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getMiddleName() 0 3 1
A getLastName() 0 3 1
A getOriginalFio() 0 3 1
A getId() 0 3 1
A isUseful() 0 3 1
A getQualityCode() 0 3 1
A getFirstName() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Appwilio\RussianPostSDK\Dispatching\Endpoints\Services\Entities;
6
7
use Appwilio\RussianPostSDK\Dispatching\DataAware;
8
use Appwilio\RussianPostSDK\Dispatching\Contracts\Arrayable;
9
10
final class NormalizedFio implements Arrayable
11
{
12
    use DataAware;
13
14
    /**
15
     * Коды качества нормализации ФИО.
16
     *
17
     * @see https://otpravka.pochta.ru/specification#/enums-clean-fio-quality
18
     */
19
    public const QUALITY_EDITED = 'EDITED';
20
    public const QUALITY_NOT_SURE = 'NOT_SURE';
21
    public const QUALITY_CONFIRMED_MANUALLY = 'CONFIRMED_MANUALLY';
22
23
    public function getId(): string
24
    {
25
        return $this->get('id');
26
    }
27
28
    public function getFirstName(): string
29
    {
30
        return $this->get('name');
31
    }
32
33
    public function getMiddleName(): string
34
    {
35
        return $this->get('middle-name');
36
    }
37
38
    public function getLastName(): string
39
    {
40
        return $this->get('surname');
41
    }
42
43
    public function getOriginalFio(): string
44
    {
45
        return $this->get('original-fio');
46
    }
47
48
    public function getQualityCode(): string
49
    {
50
        return $this->get('quality-code');
51
    }
52
53
    public function isUseful(): bool
54
    {
55
        return $this->get('valid');
56
    }
57
}
58