skymeyer / Vatsimphp

Vatsimphp - VATSIM data parser
http://skymeyer.github.io/Vatsimphp/
Apache License 2.0
29 stars 7 forks source link

Planned Attributes not present if flightplan null #38

Closed atoff closed 3 years ago

atoff commented 3 years ago

Hi Jelle,

Small difference (in my case BC) I found from upgrading from V2 to V2.0.2, based on my current code expecting there to always be planned_* attributes.

If the pilot's flight plan is null, some of the planned_ attributes seem to be missing on the pilot data object, where as previously I believe they we included blank (i.e. 'planned_depairport' => '')

Example:

Raw from VATSIM Datafeed v3 {"cid":1468017,"name":"Henry Trujillo KASH","callsign":"N550JG","server":"USA-EAST","pilot_rating":0,"latitude":42.78035,"longitude":-71.51487,"altitude":193,"groundspeed":0,"transponder":"1200","heading":211,"qnh_i_hg":29.72,"qnh_mb":1006,"flight_plan":null,"logon_time":"2021-01-04T19:50:05.0681001Z","last_updated":"2021-01-05T12:54:56.4542793Z"}

Received output from a dd inside $vatsim->getPilots()->each(function ($pilot) ...

^ array:15 [▼
  "callsign" => "N550JG"
  "cid" => "1468017"
  "realname" => "Henry Trujillo KASH"
  "latitude" => "42.78035"
  "longitude" => "-71.51487"
  "altitude" => "193"
  "groundspeed" => "0"
  "server" => "USA-EAST"
  "rating" => "0"
  "transponder" => "1200"
  "time_logon" => "20210104195005"
  "heading" => "211"
  "QNH_iHg" => "29.72"
  "QNH_Mb" => "1006"
  "clienttype" => "PILOT"
]
skymeyer commented 3 years ago

@atoff release 2.0.3 and 1.0.7 have been published which should address this issue. Thanks for reporting, let me know if you still have issues after this fix.