phpmentoring/mentor-app — pull request #35 by jcarouth (2013-10-29 20:07:36+00:00)
Title: Refactor retrieve method

@mfrost503 This one is for you.

Just a couple things I was able to get to last night and a little clean up today.

Things to note:

* Tried to maintain a consistent language between skills/tags.
* The constants for skills types I could live without but I left them in.
* I consolidated the retrieval of skills to go through the `retrieveSkills` method. Before you had that method plus were manually doing it in the `UserService::retrieve` method.
* At first glance with the level of testing you have I don't see an easy way to simplify them to not be so reliant on mocks to verify `PDO` statements and such. Personally I rarely if ever go down that route because of this exact problem and it's much more fragile with respect to changing queries and such. That said, it's academic to debate whether the tests are valuable or not.

This PR is academic at best. I intend it more as suggestions for improving the readability of the code in the service more than anything else. Hopefully it will spur some discussion.