nZEDb/nZEDb — pull request #1166 by egandt (2014-01-28 20:55:48+00:00)
Title: Refectored ReleaseCleaning to match the case structure of Collection, to make it easier to work with. (The merge however is not simple, sorry about that)

First sorry about ReleaseCleaning.php there are a lot of changes to ReleaseCleaning, but to convert from if/else to case well there was no way, and the changes are straight forward. I did try to keep the code lined up as best I could so that you can see that no regex or functionality was changed (in the future it may be a good idea to change this, but if I did that now it was a total mess), only code refactored, but again I'm sorry that changes are as large as they are. I looked at doing this as a 2 phase commit, but that was far more confusing and messy so I went with the best of the worst.

What I did:
Refectored ReleaseCleaning to match the case structure of Collection, to make it easier to work with, and cleaner.
While I was at it I also ensured that all groups are covered in each file (if there is no entry then they use generic), again this should make it easier to maintain, and since they would have defaulted to generic there is no change the logic.
I also set the function names in ReleaseCleaning to match those from CollectionsCleaning, again this should help make it easier to maintain the code going forward.

NOTE:
I changed no functional code or the logic, only converted a from an if/else to a case statement
This does mean that ReleaseCleaning.php is very different looking now, since I also needed to change the name $subject to $this->subject, but I tried to leave the spacing the same, so it is easy to see that nothing regex, logic or functionality related changed in the file.

Apology:
Again, I'm sorry this required such a large change to ReleaseCleaning, but then again there is no way to make is simple as the entire if/else needed to be converted to functions for this to work properly. I could have skipped the CollectionCleaning changes, but they are well very limited and simple so I did not see a need. Also this way starting from this merge all groups defined in these files are in sync, and we can get an idea of which ones are not covered currently by each file, hopefully this will again make coding going forward easier.

ERIC