Based on this comment: https://github.com/phpstan/phpstan/issues/1294#issuecomment-436951553 It looks like the cache of the phpDoc comments isn't rebuilt for a class that uses a trait when the file containing the trait is changed.