phpdoc
Fix broken ensureTags test
Add test for ensureTypes
Ensure the type_ids are cast to integer.