Phpdoc fixes

this fixes some phpdoc and typehints based on the Scrutinizer review
should this be an else if? or a switch?