Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2.0625 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
31 | 6 | protected function setRequestData(array $amazonRequest) |
|
32 | { |
||
33 | 6 | $this->requestId = $amazonRequest['requestId']; |
|
34 | 6 | $this->timestamp = new \DateTime($amazonRequest['timestamp']); |
|
35 | //Workaround for amazon developer console sending unix timestamp |
||
36 | try { |
||
37 | 6 | $this->timestamp = new \DateTime($amazonRequest['timestamp']); |
|
38 | } catch (\Exception $e) { |
||
39 | $this->timestamp = (new \DateTime())->setTimestamp(intval($amazonRequest['timestamp'] / 1000)); |
||
40 | } |
||
41 | 6 | $this->locale = $amazonRequest['locale']; |
|
42 | 6 | $this->token = PropertyHelper::checkNullValueString($amazonRequest, 'token'); |
|
43 | } |
||
45 |