phpinspectionsea
phpinspectionsea copied to clipboard
Php Inspections (EA Extended) | Language level migration | ::class can be used
Subject | Details |
---|---|
Plugin | Php Inspections (EA Extended) master |
Language level | PHP 7.2 |
- Your action/fix don't work: string 'CodeIgniter\Filters\DebugToolbar' in namespace
CodeIgniter\View
converted toDebugToolbar::class
-
::class
better only if classes in same namespace
Thanks for reporting @WinterSilence!
Sounds like expected behavior, we are not really sure what you do you mean by don't work
and did testing with this code fragment: https://3v4l.org/OTo07. If you could share an updated code fragment explaining your concerns, that would be very helpful. Thanks!
Out of curiosity, what do you mean by "better only if classes in same namespace"? Asking as mainstream practices are encouraging using the constant over strings.
@ea-inspections-team
don't work
as you planed
your action convert string 'CodeIgniter\Filters\DebugToolbar' in method of class CodeIgniter\View\Render
to DebugToolbar::class
, but not add use CodeIgniter\Filters\DebugToolbar;
, it's generate error because class CodeIgniter\View\DebugToolbar
not exists.
@WinterSilence could you please provide a piece of code ("before"/working and "after"/not-working)?