Issue-109: Fixed infinite recursion on JMS Types that reference themselves or their parents

New pull request everything in one commit, I ran php-cs-fixer which seems fine, I ran unit tests which ran fine (after disabling the deprecation warnings from Symfony 2.1).