Skip to content

Commit

Permalink
Фикс обработки странных пустых ответов трекинга EMS
Browse files Browse the repository at this point in the history
  • Loading branch information
jhaoda committed May 3, 2020
1 parent dc8da94 commit 2cdaaea
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Tracking/Single/TrackingEventsWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,18 @@

final class TrackingEventsWrapper
{
/** @var TrackingEvent[]|TrackingEvent */
/** @var TrackingEvent[]|TrackingEvent|null */
private $historyRecord;

/**
* @return TrackingEvent[]
*/
public function getEvents()
{
if ($this->historyRecord === null) {
$this->historyRecord = [];
}

if ($this->historyRecord instanceof TrackingEvent) {
$this->historyRecord = [$this->historyRecord];
}
Expand Down

0 comments on commit 2cdaaea

Please sign in to comment.