Closed mattwatson-sf closed 6 months ago
I've proposed a solution at OAS level https://github.com/XeroAPI/Xero-OpenAPI/pull/466, please note that this has yet to be tested or released.
Once merged, it would flow through to the PHP SDK the next time it is auto generated.
Hi - I've also noticed this error occur in the new CountryOfResidence model file
"unexpected 'EMPTY' (T_EMPTY), expecting identifier (T_STRING) in /var/www/secure/scripts/vendor/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/CountryOfResidence.php on line 298"
Is there any indication of when this issue might be fixed?
Hi @wobinb this bug is still open 2+ years later, are there any plans to fix it? I've reproduced it on PHP 5.6 all the way through to PHP 8.1
@mattwatson-sf Apologies for the delay. We have removed empty enums from OpenAPI and new version of PHP SDK is now available. Let us know if you still face the problem.
Issue is resolved in SDK v2.23.3.
Thanks! Looks to be working well. Cheers!
I am using the Payroll AU API to synchronise employee data. When invoking a function to update an employee - prior to any data being sent, I notice that PHP reports a syntax error specifically with one of the Xero PHP SDK Model files (LeaveLineCalculationType):
Parse error: syntax error, unexpected 'EMPTY' (T_EMPTY), expecting identifier (T_STRING) in vendor/xeroapi/xero-php-oauth2/lib/Models/PayrollAu/LeaveLineCalculationType.php on line 50
Looking into this Model file, on line 50 it defines a constant of EMPTY - which is a reserved keyword in PHP (you are not meant to use it for defining constants or function names):
const EMPTY = ''
It seems to be the only place in the entire Payroll AU API where this use of a reserved keyword is used. This is not a coding question - the syntax error is reported before any mapped data is passed into the function and/or sent to Xero. I simply think it's a syntax error in the SDK itself.
I've commented it out and the employee update processes successfully through to Xero