edifact icon indicating copy to clipboard operation
edifact copied to clipboard

Fatal error on integer-value segments for Encoder

Open konovalovk opened this issue 5 years ago • 2 comments

First of all, many thanks for your efforts! Better to drop argument type for Encoder::escapeValue as compatibility is broken when the source array contains integers.

private function escapeValue( >>string<< &$str): string Fatal error: Uncaught TypeError: Argument 1 passed to EDI\Encoder::escapeValue() must be of the type string, integer given

konovalovk avatar Jan 04 '19 17:01 konovalovk

You're right! Would you like to provide a pull request?

cc @voku

sabas avatar Jan 04 '19 18:01 sabas

@konovalovk can you provide a example, thanks!

PS: here is a possible fix but it needs a real world example for the tests: https://github.com/voku/edifact/commit/a25a74d283656b940cf0e914bc2f9353d7692310

voku avatar Jan 06 '19 11:01 voku