Code Duplication    Length = 6-8 lines in 2 locations

src/Webhook/DeliveryReport.php 2 locations

@@ 116-123 (lines=8) @@
113
        $this->to = $query['to'] ?? null;
114
        $this->returnData = $query['returndata'] ?? null;
115
116
        if (isset($query['receivetime'])) {
117
            $this->receiveTime = \DateTimeImmutable::createFromFormat('U', $query['receivetime']);
118
            if ($this->receiveTime === false) {
119
                throw new InvalidDateTimeFormatException(
120
                    'The format of `receivetime` is wrong. Value given: '.$query['receivetime']
121
                );
122
            }
123
        }
124
125
        if (isset($query['statuscode'])) {
126
            $this->statusCode = (int)$query['statuscode'];
@@ 129-134 (lines=6) @@
126
            $this->statusCode = (int)$query['statuscode'];
127
        }
128
129
        if (isset($query['logdate'])) {
130
            $this->logDate = \DateTimeImmutable::createFromFormat('Y_m_d', $query['logdate']);
131
            if ($this->logDate === false) {
132
                throw new InvalidDateTimeFormatException('The format of `logdate` is wrong. Value given: '.$query['logdate']);
133
            }
134
        }
135
136
        if (isset($query['mcc'])) {
137
            $this->mcc = (int)$query['mcc'];