laravel-microsoft-graph icon indicating copy to clipboard operation
laravel-microsoft-graph copied to clipboard

Wrong return types?

Open SuryaWebfox opened this issue 1 year ago • 0 comments

In https://github.com/dcblogdev/laravel-microsoft-graph/commit/0f407d00c098357f95505307507cca8b97733d78#diff-9f3a205ebdd03435644801c898d52c2a2f08dc7e707f3f2511f56f8dc1744b38 return types of MsGraph were added to many (all?) of the resources

So I get an error when doing

MsGraph::tasklists()->get()

Dcblogdev\MsGraph\Resources\Tasks\TaskLists::get(): Return value must be of type Dcblogdev\MsGraph\Facades\MsGraph, array returned

I checked the code and in many cases the get() function of a resource will return either the content of the Guzzle call or a json_decoded version if the Guzzle call returned JSON. Neither of which will be an MsGraph instance, so I can't see how this return type is correct?

I see that version 3.2.4 didn't have the return types yet, they were added in version 3.2.5, which is the first version to support Laravel 11. Since I am using Laravel 11, I can not use a version that doesn't use these return types.

Please confirm if I am correct that these return types are in fact not correct?

SuryaWebfox avatar Sep 13 '24 03:09 SuryaWebfox