Per Issue #122 - Applied @qpleple's patch to support traits

This is the patch that @qpleple supplied via comment and has been working well for me. Generally I would provide test cases for you, but since traits are only available in PHP 5.4+ I am not sure how you might want such a test case structured.