snowcap / Emarsys

PHP HTTP client for Emarsys webservice
MIT License
39 stars 37 forks source link

GET Endpoint /contactlist doesn't accept any data #42

Closed timkley closed 3 years ago

timkley commented 7 years ago

As stated in the official documentation, the GET endpoint /contactlist is not filterable as you would think by the current implementation.

If you provide anything but an empty array, you'll receive the following, misleading error:

object(Snowcap\Emarsys\Response)#4 (3) { ["replyCode":protected]=> int(10001) ["replyText":protected]=> string(21) "Invalid filter: limit" ["data":protected]=> string(0) "" }

I propose to remove the need of specifying an array completely.

tim-bezhashvyly commented 7 years ago

I'm hesitant about dropping getContactList method argument as this will be a BC breaking modification. Alternatively we can keep it but don't pass to Emarsys. This is a code smell but keeps a BC.

I personally would drop it and release version 2.0.0. Your call @Moinax.

Moinax commented 7 years ago

Maybe can we keep it in minor version with @deprecated notation (as suggested by @tim-bezhashvyly ) and remove it in the next major version.

timkley commented 6 years ago

How should a I mark only the param as deprecated? Should it trigger an error?

HellPat commented 6 years ago

This is a difficult topic as there is no standardized way to do so, as far as i know. The Symfony-Way is to trigger a "muted" error.

@trigger_error('.........', E_USER_DEPRECATED)

which can be handled by a custom error-handler.

There is no IDE support thought... (Poor, I know, but don't know any other way aroud it)