Hi @guoliangwang
1. About Warning/Error Codes (1124, 1410, etc.)
Error 1124 — Using non-Adobe Commerce API class
- This means the class you're using is not marked with @api, hence not guaranteed to be stable across versions.
- Even if the code is the same in Magento 2.4.5 and 2.4.7, Magento now enforces stricter use of public APIs only for stability in future upgrades.
Example:
Magento\SalesRule\Model\ResourceModel\Coupon\Usage — not marked as @api.
Fix Approach:
- Search for an alternative class or interface marked with @api.
- Unfortunately, Adobe does not provide a full list of alternatives, so you have to:
- Check the class PHPDoc in the codebase to see if it's @api.
- Google or search GitHub for common replacements or usage.
- Use Magento DevDocs or StackOverflow to look up specific classes.
False Positives? — Yes, some users (and even Adobe forums) mention UCT can raise false positives for this error. Confirm by checking if the class truly lacks @api.
2. Critical Error 1410 — Call non-existent Adobe Commerce method
Your code example:
Magento\Customer\Model\Session\Proxy::isLoggedIn
But you checked: This method exists in both 2.4.5 and 2.4.7.
So why does UCT show this?
- Likely a false positive. This method exists, but UCT sometimes flags Proxy calls incorrectly.
- It’s recommended to avoid calling methods on Proxy classes directly. Instead, inject the real class if possible.
Fix Options:
- Replace Proxy call with dependency injection of Magento\Customer\Model\Session directly.
- Or use \Magento\Framework\App\Http\Context with Context::CONTEXT_AUTH.
3. How to Find Alternative Classes/Methods?
Sadly, no official full list from Adobe for replacement suggestions exists yet. Here’s how to find them:
Recommended Steps:
1. Look at deprecation notices: In the class/method PHPDocs.
2. Magento DevDocs > Release Notes: Check what’s deprecated/removed.
3. Use Magento's GitHub repo: Search for your class/method and see if it was modified.
4. StackOverflow: Often has workarounds and replacement suggestions.
5. For non-API class usage, prefer:
- Interfaces over concrete classes.
- Classes/services from Magento\Framework namespace.
Error Code: 1124 (Using class not marked with @api)
Root Cause: UCT flags classes without @api annotation even if present in both Magento 2.4.5 and 2.4.7
Conclusion: Code is correct and unchanged, but UCT still flags it due to future compatibility rules. No official replacement list from Adobe.
Error Code: 1410 (Calling a non-existent method (false positive)
Root Cause: Method exists in both versions, but UCT flags it likely due to usage of Proxy class
Conclusion: Method like isLoggedIn() exists. Flag is likely due to calling method on a Proxy, not the real class. Best to avoid Proxy direct calls.
Your Next Steps:
- For 1124: Try finding @api interfaces/classes and replace non-API usage.
- For 1410: Confirm method presence (you did); refactor Proxy usage.
- If you’re confident about false positives, document and suppress them, especially if your QA tests pass.
Regards,
Amit