phpro / soap-client

A general purpose SOAP client for PHP
MIT License
861 stars 175 forks source link

v4 codegen: improve `IsResultRule` to recognize base result types #550

Closed rauanmayemir closed 2 months ago

rauanmayemir commented 2 months ago

Feature Request

Q A
New Feature yes
RFC no
BC Break no

Summary

When using assemblers like this:

new Rules\IsRequestRule(
    $metadata,
    new Rules\AssembleRule(new Assembler\RequestAssembler()),
),
new Rules\IsResultRule(
    $metadata,
    new Rules\AssembleRule(new Assembler\ResultAssembler()),
)

IsResultRule collects return type from the method, but method return type is mapped to the method name. I.e for a method methodName(MethodNameRequestType $request): MethodNameResultTypeResponse generated client correctly expects base ResultTypeResponse instead of MethodNameResultTypeResponse, but ResultTypeResponse type doesn't implement ResultInterface because it is not recognized as a return type.