AfriCC / php-epp2

A High Level EPP TCP/SSL Client for PHP
GNU General Public License v3.0
54 stars 31 forks source link

ResponseFactory::build and handling invalid input #66

Closed johnny-bit closed 4 years ago

johnny-bit commented 5 years ago

While writing test for pull #65 I wondered about ResponseFactory::build and it's handling of invalid input.

Incorrect input is set to return string with whole input. Shouldn't we handle it by either returning false (1st error condition), throwing exception (2nd) or creating fake response with unsuccessful state (3rd)?

I'd be for handling it as 1 or 2, would signal clearer error ;) fake response would be a bit more to chew :)

johnny-bit commented 4 years ago

When writting #85 I thought about it and I think returning string is OK