解决Laravel迁移文件的此错误:每个类必须位于至少一个级别的名称空间中 [英] Resolve this error for Laravel migration file: Each class must be in a namespace of at least one level

查看:186
本文介绍了解决Laravel迁移文件的此错误:每个类必须位于至少一个级别的名称空间中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何解决此phpcs错误?它会在所有Laravel迁移文件中显示类Keyword.错误消息是:

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

每个类必须在至少一个级别(顶级)中的命名空间中 供应商名称)phpcs

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

推荐答案

您可以通过多种方式进行操作

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

第二个可以使用

// @codingStandardsIgnoreLine

就在类声明之前.

希望其中任何一种都能为您服务. 如果问题仍然存在,请通知我.

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

这篇关于解决Laravel迁移文件的此错误:每个类必须位于至少一个级别的名称空间中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆