added closureToPHP implementation in MongoDB type