Resolve this error for Laravel migration file: Each class must be in a namespace of at least one level

北慕城南 提交于 2020-01-02 05:44:08

问题


How to resolve this phpcs error? It shows up for the class Keyword in all Laravel migrations files. The error message is:

Each class must be in a namespace of at least one level (a top-level vendor name) phpcs


回答1:


You can do it in many ways and

First you can put this at the top of your file:

// phpcs:disable 
PSR1.Classes.ClassDeclaration.MissingNamespace

Second you can use

// @codingStandardsIgnoreLine

Just before your class declaration.

Hope any one of these will work for you. If problem still persists please let me know about this.



来源:https://stackoverflow.com/questions/53919231/resolve-this-error-for-laravel-migration-file-each-class-must-be-in-a-namespace

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!