DoSomething/user-api — pull request #10 by jonuy (2014-12-16 22:59:58+00:00)
Title: User DELETE and PUT update

#### What's this PR do?
Two main things I wanted to do:
- implement `DELETE /users/:id`. I'm thinking of at least using this for cleaning up dummy accounts that could be created by tests.
- modify `PUT /users/:id` so that only non-null values update the resource. Otherwise, the PUT request needs to include the full representation of a resource.

But then along the way I also added the `USER_PARAMS` and `RESPONSE_PARAMS` abstract classes that effectively act like enums. Using these should help guard against typos and copy and paste errors - especially with help from autocomplete features in IDEs like PhpStorm. Using the abstract classes also clearly defines what the available params are.

#### Where should the reviewer start?
- Line 97 of UserController.php where I added `!is_null($value)` is effectively where the PUT becomes more like a PATCH.
- and the `destroy` function added to UserController is what responds to a `DELETE`.
- USER_PARAMS and RESPONSE_PARAMS values should match up with the params they're replacing

#### How should this be manually tested?
Running the phpunit tests should be sufficient.

#### Questions
This PR changes the `PUT` behavior to be like a `PATCH`. Any objections to this? It doesn't seem like PATCH is an official standard yet (http://restful-api-design.readthedocs.org/en/latest/methods.html#patch-vs-put), and I'm not sure if Laravel distinguishes between the two either.

@codal-sara @angaither