Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong check result #44

Open
iranimij opened this issue Nov 14, 2023 · 4 comments
Open

Wrong check result #44

iranimij opened this issue Nov 14, 2023 · 4 comments

Comments

@iranimij
Copy link
Contributor

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.

@jissereitsma
Copy link
Contributor

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.

@iranimij
Copy link
Contributor Author

iranimij commented Nov 23, 2023

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 ?

@jissereitsma
Copy link
Contributor

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.

@akosglue
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants