Fix categories bug

When using the string type,
$typeid == 1 matched all strings making other conditions ineffective.
Updated category fix

Categories ID can be passed as strings
PSR code formatting
Merge pull request #1815 from GPCsolutions/catbug

Fix categories bug