Simplified the parseTag function

A switch statement would be far more appropriate here.
Better to add new line after `array(` to have consistent formatting.