Yireo_ExtensionChecker icon indicating copy to clipboard operation
Yireo_ExtensionChecker copied to clipboard

Wrong check result

Open iranimij opened this issue 1 year ago • 4 comments

I have two modules, one in app/code and another one in my custom route src that is defined correctly in the main composer. I have created a module in src folder and then required a constant from the src folder into the module that is in app/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.

iranimij avatar Nov 14 '23 07:11 iranimij

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.

jissereitsma avatar Nov 14 '23 19:11 jissereitsma

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 ?

iranimij avatar Nov 23 '23 09:11 iranimij

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.

jissereitsma avatar Nov 23 '23 09:11 jissereitsma

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.

akosglue avatar Jul 12 '24 11:07 akosglue