Add checks to see if we have a class to instantiate

Also added a special case for when we're mistakenly trying to instantiate an interface
Add test for exception thrown when trying to construct an interface
Tidy up CS violations
Remove incorrect @package annotations
Merge pull request #4790 from nickpeirson/DIClassExistenceCheck

Add check to DI to see if we have a class to instantiate
[#4790] CS fixes

- Use sprint for exception message string interpolation
- No need for escaping namespace separators when class names are
  uppercase
Merge branch 'hotfix/4790'

Close #4790