regroup common behavior

Hello,

I submit you a PR for regrouping common behavior between Class, Interface and Trait statements.

It's an idea that pop up in my mind tonight, so maybe it's a bad idea or perhaps you DO want to split each PHP statement (I can understand)

Give me your opinion and I can expand this with further tests (a TraitTest, an InterfaceTest etc...). 
Unit tests are ok but since CC is not 100%, I could have broke something I did not see.

I think it is also useful to strong type some parameters in visitors.

Hope this helps :beers: