Conditions | 7 |
Paths | 8 |
Total Lines | 25 |
Code Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Tests | 16 |
CRAP Score | 7.0671 |
Changes | 0 |
1 | <?php |
||
48 | 3 | public function __construct(\stdClass $oData) |
|
49 | { |
||
50 | 3 | $this->provinceId = $oData->WOJ; |
|
51 | 3 | $this->districtId = $oData->POW; |
|
52 | 3 | $this->communeId = $oData->GMI; |
|
53 | 3 | $this->communeTypeId = $oData->RODZ; |
|
54 | 3 | $this->name = $oData->NAZWA; |
|
55 | 3 | $this->typeName = $oData->NAZWA_DOD; |
|
56 | 3 | $this->statusDate = $oData->STAN_NA; |
|
57 | |||
58 | try { |
||
59 | 3 | $this->statusDate = $oData->STAN_NA ? (new \DateTime($oData->STAN_NA))->format('Y-m-d') : null; |
|
60 | } catch (\Exception $e) { |
||
61 | $this->statusDate = null; |
||
62 | } |
||
63 | |||
64 | 3 | if ($this->provinceId && $this->districtId && $this->communeId && $this->communeTypeId) { |
|
65 | 1 | $this->tercId = intval(sprintf("%s%s%s%s", |
|
66 | 1 | $this->provinceId, |
|
67 | 1 | $this->districtId, |
|
68 | 1 | $this->communeId, |
|
69 | 1 | $this->communeTypeId)); |
|
70 | } |
||
71 | |||
72 | 3 | parent::__construct(); |
|
73 | 3 | } |
|
75 |