Fix to prevent error when $id is not a MongoId
add a validity check on Uid
Checkstyle fix
fix again checkstyle (misconfiguration of IDE :( )
add newline for phpcs