Skip to content

Messed up return types #83

@mcinp

Description

@mcinp

ODataClient::get() is described in phpdoc as returning IODataRequest object.
This method further calls ODataClient::request() (the same @return IODataRequest object description).

What gets called in the end is
\SaintSystems\OData\ODataRequest::execute() which is described as
@return mixed object or array of objects of class $returnType

So when I want to iterate over the results with foreach, I get proper code execution, but phpstan correctly complains:

Argument of an invalid type SaintSystems\OData\IODataRequest supplied for foreach, only iterables are supported.

Please provide consistent return type hinting...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions