php-ews icon indicating copy to clipboard operation
php-ews copied to clipboard

Enclose FreeBusyResponse in an array in areAvailable

Open nuggex opened this issue 3 years ago • 2 comments

In the current master branc areAvailable fails with error PHP Warning: array_map(): Expected parameter 2 to be an array, object given in ../vendor/garethp/php-ews/src/CalendarAPI.php on line 314

This is due to the second argument to the array_map function not being an array.

nuggex avatar Mar 15 '23 14:03 nuggex

@kambereBr Can you please evaluate this one? Tks

marclaporte avatar Aug 26 '25 21:08 marclaporte

@nuggex the original error has changed due to massive changes in https://github.com/Garethp/php-ews/pull/265

Instead of the previous array_map error, it now shows:

Expected type 'object'. Found 'garethp\ews\API\Message\FreeBusyResponseType[]'.

This message error is currently appearing on lines 307 and 314 (src/CalendarAPI.php)

I suggest:

  1. Rebase against current master to get latest changes from PR https://github.com/Garethp/php-ews/pull/265
  2. Update your fix to address the new type mismatch error, not the old array_map issue

Thanks!

kambereBr avatar Aug 27 '25 12:08 kambereBr