Bug Report
| Q |
A |
| BC Break |
yes/no |
| Version |
4.4.1 |
Summary
The generated types that use an enum of type string create a fatal error exception:
Got error 'PHP message: PHP Fatal error: Declaration of namespace\\Type\\CodeNachrichtAntwortCode::getCode(): namespace\\Type\\CodelisteNachrichtAntwortCode must be compatible with namespace\\Type\\Code::getCode(): string
Current behavior
The generated code for the complexType Code.NachrichtAntwortCode has an element named code of type xzufi:Codeliste.NachrichtAntwortCode in the imported schema xzufi-baukasten.xsd (which itself is imported in xzufi-leistungen.xsd). It is an enumeration of strings and the following type gets generated:
enum CodelisteNachrichtAntwortCode: string {
case Value_000 = '000';
case Value_001 = '001';
case Value_101 = '101';
}
The get- and with-methods want to have an object of this type:
class CodeNachrichtAntwortCode extends Code
{
// stripped code
/**
* @return namespace\Type\CodelisteNachrichtAntwortCode
*/
public function getCode() : namespace\Type\CodelisteNachrichtAntwortCode
{
return $this->code;
}
/**
* @param namespace\Type\CodelisteNachrichtAntwortCode $code
* @return static
*/
public function withCode(namespace\Type\CodelisteNachrichtAntwortCode $code) : static
{
$new = clone $this;
$new->code = $code;
return $new;
}
}
My IDE is already complaining about these types (Return type declaration must be compatible with Code->getCode() : string ). Also the real values are just the strings in the soap-communication:
<xzufi:antwortrueckgabecode listURI="urn:xoev-de:fim:codeliste:xzufi.nachrichtantwortcode" listVersionID="1.1">
<code>000</code>
</xzufi:antwortrueckgabecode>
How to reproduce
- Run
./vendor/bin/soap-client generate:types --config config/soap-client.php for https://xzufi-v2-2-0-nw-schul.infodienste.de/?wsdl (warning: it will generate 1400 files...)
- Look into the type for
CodeNachrichtAntwortCode.php and see that the method getCode() returns \namespace\Type\CodelisteNachrichtAntwortCode and withCode expects \namespace\Type\CodelisteNachrichtAntwortCode
Expected behavior
The generated values for the get- and with- methods should be of the type of the enums (in my case string) instead of expecting the generated-enum-type class as a value.
Bug Report
Summary
The generated types that use an enum of type
stringcreate a fatal error exception:Current behavior
The generated code for the complexType
Code.NachrichtAntwortCodehas an element namedcodeof typexzufi:Codeliste.NachrichtAntwortCodein the imported schema xzufi-baukasten.xsd (which itself is imported in xzufi-leistungen.xsd). It is an enumeration of strings and the following type gets generated:The get- and with-methods want to have an object of this type:
My IDE is already complaining about these types (Return type declaration must be compatible with Code->getCode() : string ). Also the real values are just the strings in the soap-communication:
How to reproduce
./vendor/bin/soap-client generate:types --config config/soap-client.phpforhttps://xzufi-v2-2-0-nw-schul.infodienste.de/?wsdl(warning: it will generate 1400 files...)CodeNachrichtAntwortCode.phpand see that the methodgetCode()returns\namespace\Type\CodelisteNachrichtAntwortCodeandwithCodeexpects\namespace\Type\CodelisteNachrichtAntwortCodeExpected behavior
The generated values for the get- and with- methods should be of the type of the enums (in my case
string) instead of expecting the generated-enum-type class as a value.