aRefactored some parts using switch/case to make it more readable.
Merge branch 'master' of https://github.com/OpenSRS/osrs-toolkit-php