LinguaLeo/expert-sender-api — pull request #6 by MacDada (2014-04-16 17:43:43+00:00)
Title: Add user to list request value object

`$expertSender->addUserToList()` has got a lot arguments and the number will grow (it's already missing `$force`, `$name`, `$force`, `$trackingCode`, `$vendor` attributes).

I created a `AddUserToListRequest` class which should ease creating subscriptions. Instead off passing gazillion arguments to `addUserToList()`, one can call `addUserToListRequest($request)`, where `$request` is their simple value object.

Example:

$request = (new AddUserToListRequest())
->setEmail($email)
->setListId($listId)
->freeze();
$expertSender->addUserToListRequest($request);

It also validates required attributes.

Few things could be changed, I will write them in code comments.