Symfony does not comment non-public properties and in this case the IDE can guess the type because there is a constructor injection. Here I kept it https://github.com/florianv/FOSRestBundle/blob/code-style/EventListener/BodyListener.php#L32-L35 because there is setter injection and the IDE can't guess