I am trying to upload my extension to Marketplace. I'm using Magento 2.2 as a platform for my extension. However, whenever I upload my extension this error appears in my Test Report

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

This error appears to me also for PHP 7.0.31 and 7.1.22. I support several other PHP versions, but these two ones are the only one that is triggering this error

Also, the next error is showing up in the Test Reports:

Direct use of $GLOBALS Superglobal detected.

A screenshot is shown below. This error is triggering in the same versions mentioned above

What thrills me the most is this error is only showing off for these two versions of PHP, also this kind of error seems to for the code generated not for the code I'm uploading itself.

  • can you check if you are using $_GLOBALS variable in your code. Magento will not allow this. and IF you are not sure about Code Please check your extension code in EQP first github.com/magento/marketplace-eqp (USE MEQP2 for magento2) – nishu Jun 28 '19 at 5:49
  • I have developed this code by myself. I never used $_GLOBALS variable or tag anywhere in my code. – dirac Jun 28 '19 at 17:17
  • can you still check your extension code using above EQP because it will scan your code and will let you know exact file name in which he will find any issue. This is a very simple process. Hope this solves your issue. – nishu Jul 1 '19 at 4:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.