Code Duplication    Length = 51-64 lines in 2 locations

src/mrcnpdlk/Teryt/ResponseModel/Territory/Ulica.php 1 location

@@ 28-91 (lines=64) @@
25
 *
26
 * @package mrcnpdlk\Teryt\ResponseModel\Territory
27
 */
28
class Ulica extends AbstractResponseModel
29
{
30
    /**
31
     * Zawiera cechę ulicy
32
     *
33
     * @var string
34
     */
35
    public $streetIdentity;
36
    /**
37
     * Nazwa ulicy
38
     *
39
     * @var string
40
     */
41
    public $streetName;
42
    /**
43
     * Identyfikator ulicy
44
     *
45
     * @var string
46
     */
47
    public $streetId;
48
    /**
49
     * 7 znakowy identyfikator miejscowości
50
     *
51
     * @var string
52
     */
53
    public $cityId;
54
    /**
55
     * Nazwa ulicy
56
     *
57
     * @var string
58
     */
59
    public $cityName;
60
61
    /**
62
     * Ulica constructor.
63
     *
64
     * @param \stdClass|null $oData Obiekt zwrócony z TerytWS1
65
     */
66
    public function __construct(\stdClass $oData = null)
67
    {
68
        if ($oData) {
69
            $this->streetIdentity = $oData->Cecha;
70
            $this->communeTypeId  = $oData->GmiRodzaj;
71
            $this->communeId      = $oData->GmiSymbol;
72
            $this->communeName    = $oData->Gmina;
73
            $this->cityId         = $oData->IdentyfikatorMiejscowosci;
74
            $this->streetId       = $oData->IdentyfikatorUlicy;
75
            $this->streetName     = $oData->Nazwa;
76
            $this->cityName       = $oData->NazwaMiejscowosci;
77
            $this->districtId     = $oData->PowSymbol;
78
            $this->districtName   = $oData->Powiat;
79
            $this->provinceId     = $oData->WojSymbol;
80
            $this->provinceName   = $oData->Wojewodztwo;
81
82
            try {
83
                $this->statusDate = $oData->DataStanu ? (new \DateTime($oData->DataStanu))->format('Y-m-d') : null;
84
            } catch (\Exception $e) {
85
                $this->statusDate = null;
86
            }
87
        }
88
89
        parent::__construct();
90
    }
91
}
92

src/mrcnpdlk/Teryt/ResponseModel/Territory/WyszukanaMiejscowosc.php 1 location

@@ 28-78 (lines=51) @@
25
 *
26
 * @package mrcnpdlk\Teryt\ResponseModel\Territory
27
 */
28
class WyszukanaMiejscowosc extends Miejscowosc
29
{
30
    /**
31
     * Identyfikator miejscowości podstawowej
32
     *
33
     * @var string
34
     */
35
    public $cityParentId;
36
    /**
37
     * Symbol rodzaju miejscowości
38
     *
39
     * @var string
40
     */
41
    public $rmId;
42
    /**
43
     * Nazwa rodzaju miejscowości
44
     *
45
     * @var string
46
     */
47
    public $rmName;
48
49
    /**
50
     * WyszukanaMiejscowosc constructor.
51
     *
52
     * @param \stdClass $oData Obiekt zwrócony z TerytWS1
53
     */
54
    public function __construct(\stdClass $oData)
55
    {
56
        $this->communeId     = $oData->Gmi;
57
        $this->communeName   = $oData->Gmina;
58
        $this->cityName      = $oData->Nazwa;
59
        $this->districtId    = $oData->Pow;
60
        $this->districtName  = $oData->Powiat;
61
        $this->rmId          = $oData->Rm;
62
        $this->rmName        = $oData->RodzajMiejscowosci;
63
        $this->communeTypeId = $oData->RodzajGminy;
64
        $this->cityId        = $oData->Symbol;
65
        $this->cityParentId  = $oData->SymbolPodst;
66
        $this->provinceId    = $oData->Woj;
67
        $this->provinceName  = $oData->Wojewodztwo;
68
69
        try {
70
            $this->statusDate = $oData->DataStanu ? (new \DateTime($oData->DataStanu))->format('Y-m-d') : null;
71
        } catch (\Exception $e) {
72
            $this->statusDate = null;
73
        }
74
75
        parent::__construct();
76
    }
77
78
}
79