I am developing an extension for magento2 but when I try to install it on my server to perform tests I get the following error:
Constant name is expected
Verifying the nginx logs I get the following message:
PHP message: PHP Fatal error: Uncaught InvalidArgumentException: Constant name is expected. in ... / magento2-2.2.2 / vendor / magento / framework / Data / Argument / Interpreter / Constant.php: 24
According to this file I see that it does not find a class that I define in the file /etc/di
.
<virtualType name="TestPaymentsConfig" type="Magento\Payment\Gateway\Config\Config">
<arguments>
<argument name="methodCode" xsi:type="const">\Test\Payments\Model\Ui\ConfigProvider::CODE</argument>
</arguments>
</virtualType>
For the installation I upload the extension in app/code/Magento
and I install it from the Module Manager , I think composer is not registering the namespace of the extension and therefore the error, well I do not have the extension either in a github repository only in my store.