You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The PHP XML client currently parses all data as string. I'd really like it to at least parse boolean values as boolean, but I'm uncertain about the consequences.
If anyone out there use the PHP XML client, they'd might now be doing isAvailable() === 'true', and if I commit a patch for the parser this would turn into a false since isAvailable() would not equal a boolean true with ===.
On the other hand, it's much easier to work with booleans as boolean. That would allow me to do isAvailable() without the explicit === 'true'.
Maybe both variations could be supported by allowing a configurable variable for the PHP XML client module, something like useRealTypes?
Note! I'd be more than happy to contribe with a patch. I'd just like to hear if this could have unforeseen consequences.
I'm not too concerned about backwards compatibility for the generated client code. I'd say just submit the patch and let people deal with the compatibility issues.
Alright!
But, if I wanted to make it configurable, is there a way to inject config
variables into a freemarker template (which generates the client)?
Do you work with any particular coding standards in the fmt files by the
way (indents etc)? I might try to make the fmt files slightly more readable
as well.
Cheers!
On 11. januar 2019 17:24:47 Ryan Heaton ***@***.***> wrote:
I'm not too concerned about backwards compatibility for the generated
client code. I'd say just submit the patch and let people deal with the
compatibility issues.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
The PHP XML client currently parses all data as
string
. I'd really like it to at least parse boolean values asboolean
, but I'm uncertain about the consequences.If anyone out there use the PHP XML client, they'd might now be doing
isAvailable() === 'true'
, and if I commit a patch for the parser this would turn into a false sinceisAvailable()
would not equal aboolean
true with===
.On the other hand, it's much easier to work with booleans as
boolean
. That would allow me to doisAvailable()
without the explicit=== 'true'
.Maybe both variations could be supported by allowing a configurable variable for the PHP XML client module, something like
useRealTypes
?Note! I'd be more than happy to contribe with a patch. I'd just like to hear if this could have unforeseen consequences.
What's your thoughts on this @stoicflame?
The text was updated successfully, but these errors were encountered: