Open iranimij opened 12 months ago
I think it is a bug too. Could you share the PHP code with which you have linked module A to module B? If you are worried about namespaces uncovering specific details, just rewrite them to dummy namespaces.
Below code is from a module inside app/code
and it uses Mainwebsite\Configuration\Model\GeneralConfig
that is in src folder.
<?php
namespace Mainwebsite\AsyncTasks\Model;
use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Sales\Api\OrderRepositoryInterface;
use Mainwebsite\Configuration\Model\GeneralConfig;
echo GeneralConfig::SECOND_SLACK_URL;
May I work on this issue and send my PR ?
Thanks. Yes, this looks pretty much like a bug. It should be picking up on that constant without an issue. Feel free to work on it! :) I'm these weeks pretty much locked up in work, so can't work on it myself quickly.
It might be solved in the meantime. I have set up the same module configuration as in your issue @iranimij One module in the app/code folder, like a traditional module. The other one is in the src folder, loaded by psr-4 via the magento composer.json (the modules, of course, have their own composer.json as well) Then I added a static constant reference in the module in the app/code folder. It is working obviously because I tested it. Then I ran the dependency checker and it listed the module that sits in the src folder. Bottom line: I cannot reproduce the issue, it works as intended.
I have two modules, one in
app/code
and another one in my custom routesrc
that is defined correctly in the main composer. I have created a module insrc
folder and then required a constant from thesrc
folder into the module that is inapp/code
folder.so theoretically the module that is in app/code should have a dependency
but in practice Yireo extension checker does not find it and I think it's a bug.