Open phil-davis opened 1 year ago
A check like this:
if ('\OpenAPI\Client\Model\CollectionOfTags' === '\SplFileObject')
compares 2 string literals. It will never be true.
And all branches of the switch
statement return
from the function. So the later code starting with
$returnType = '\OpenAPI\Client\Model\CollectionOfTags';
if ($returnType === '\SplFileObject') {
...
Is unreachable.
Are there things that need to be tweaked for the code generator?
The generated go (for comparison) is in: https://github.com/owncloud/libre-graph-api-go/blob/main/api_tags.go
GetTagsExecute
looks OK. It tests for if localVarHTTPResponse.StatusCode >= 300 {
to decide if there was a problem.
The code does not do any of the "strange" if-statements that are in the PHP.
The code is still like this, as at the date of this comment. I suppose that the "happy path" that is always executed is OK. We are not finding problems when using this.
Example from https://github.com/owncloud/libre-graph-api-php/blob/main/lib/Api/TagsApi.php
getTagsWithHttpInfo()
Note: the first PHP was generated by https://github.com/owncloud/libre-graph-api/pull/113