coding-standard icon indicating copy to clipboard operation
coding-standard copied to clipboard

ReferenceViaFullyQualifiedName fix introduces error

Open bavo-isaac opened this issue 4 years ago • 4 comments

hi,

I noticed the following file is not correctly handled by autofixing the violation Namespaces.ReferenceUsedNamesOnly.ReferenceViaFullyQualifiedName and actually breaks the application.

namespace App;

class Application extends \Illuminate\Foundation\Application
{
}

Expected result is that the file can not be fixed automaticly, "Application" should be imported using an alias, I don't expect the fixer to do this for me. Instead the fully qualified reference is removed nothing is import.

namespace App;

class Application extends Application
{
}

Keep up the great work!

Thx

bavo-isaac avatar May 28 '21 06:05 bavo-isaac

@bavo-isaac Do you use allowFullyQualifiedNameForCollidingClasses option?

kukulich avatar May 28 '21 08:05 kukulich

@kukulich No I do not, because I don't want to allow those. It's up to developer to use an alias or seek another solution.

bavo-isaac avatar May 28 '21 08:05 bavo-isaac

Ok, your problem cannot be solved currently.

kukulich avatar May 28 '21 08:05 kukulich

@kukulich having the same problem... Any updates on this issue?

Alainvdz99 avatar Jun 10 '21 07:06 Alainvdz99