Skip to content
New issue

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

Exception occurs in InvoiceMapper when mapping invoice from Twinfield #180

Open
willemo opened this issue Sep 10, 2020 · 1 comment
Open

Comments

@willemo
Copy link

willemo commented Sep 10, 2020

When the incoming invoice from Twinfield has a performancetype tag, the mapper tries to use setPerformanceType() on the InvoiceLine to set the value. The setter expects the PerformanceType enum, but the value from the XML document is never cast to the enum and passed as a string.

The following exception then occurs:

Argument 1 passed to PhpTwinfield\InvoiceLine::setPerformanceType() must be an instance of PhpTwinfield\Enums\PerformanceType or null, string given, called in vendor/php-twinfield/twinfield/src/Mappers/InvoiceMapper.php on line 107

This means either the method signature should allow strings to be passed, or the string from the XML document should be cast to the PerformanceType enum before calling the setter.

@willemstuursma
Copy link
Contributor

Hi @willemo, PR's welcome for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants