PHP-CS-Fixer: Fixer for missing root namespaces in @expectedException

From https://github.com/symfony/symfony/issues/19237

I noticed this at the workflow component and decided to do a quick scan

Im talking about @expectedException \Exception vs. @expectedException Exception. Without use statements the latter works for phpunit but breaks editor click-throughs, at least phpstorm.

Searched with @expectedException\s+[^\\\s] with 34 results on master (not checked for use statements). Perhaps something to automate?

Not sure about this one 😃

I would be nice if we can force consistent behaviour, i.e. convert everything to use statements, or everything to FQCN’s without use statements.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 29 (29 by maintainers)

Most upvoted comments

By “partial” i mean relative, i.e.;

Well, really, you mean “aliased”. That’s what’s actually going on.

also, when possible (depends on PHPUnit version) I would suggest to use ->expectException instead of annotation