We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This is a regression in #96.
Given the following XSD:
<xs:schema targetNamespace="http://www.example.com" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:complexType name="ExampleType"> <xs:attribute name="ExampleAttribute"> <xs:simpleType> <xs:restriction base="xs:NMTOKENS"> <xs:enumeration value="Master"/> <xs:enumeration value="Arrival"/> <xs:enumeration value="Departure"/> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:complexType> </xs:schema>
Die restriction on the ExampleAttribute of type NMTOKENS is treated as an list/array. The following PHP Code get generated:
ExampleAttribute
NMTOKENS
/** * Gets as exampleAttribute * * @return string[] */ public function getExampleAttribute() { return $this->exampleAttribute; } /** * Sets a new exampleAttribute * * @param string $exampleAttribute * @return self */ public function setExampleAttribute(array $exampleAttribute) { $this->exampleAttribute = $exampleAttribute; return $this; }
When using the almost exact xsd with xs:restriction base="xs:string" the attribute is treated a scalar:
xs:restriction base="xs:string"
<xs:schema targetNamespace="http://www.example.com" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:complexType name="ExampleType"> <xs:attribute name="ExampleAttribute"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="Master"/> <xs:enumeration value="Arrival"/> <xs:enumeration value="Departure"/> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:complexType> </xs:schema>
/** * Gets as exampleAttribute * * @return string */ public function getExampleAttribute() { return $this->exampleAttribute; } /** * Sets a new exampleAttribute * * @param string $exampleAttribute * @return self */ public function setExampleAttribute($exampleAttribute) { $this->exampleAttribute = $exampleAttribute; return $this; }
The text was updated successfully, but these errors were encountered:
Hmm, right! that should be fixed!
Sorry, something went wrong.
@bcremer are you interested in providing a fix for this?
No branches or pull requests
This is a regression in #96.
Given the following XSD:
Die restriction on the
ExampleAttribute
of typeNMTOKENS
is treated as an list/array.The following PHP Code get generated:
When using the almost exact xsd with
xs:restriction base="xs:string"
the attribute is treated a scalar:The text was updated successfully, but these errors were encountered: