Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.
SOLVED

How to fix the errors of uct report when upgrate from 2.4.5-p8 to 2.4.7

Avatar

Level 2

1. how to update code like above?

guoliangwa_0-1741585435816.pngguoliangwa_1-1741585469009.png

 i had checked the related code, this class of Magento\SalesRule\Model\ResourceModel\Coupon\Usage is the same code in 2.4.5 and 2.4.7. why does the report occur this error? Update code to use a class marked as @api, how to find the solution of alternative code?  the offical doc show a list of alternative code?  i did not find those doc.  from google, I see someone said 1124 msg code related error in report do not care because the report have false positive issue.

 

2. how to fix the type of error(critical level)

 

guoliangwa_2-1741586155501.pngguoliangwa_3-1741586179348.png

    i had checked the related code in different magento version,  it is the same code in 2.4.5 and 2.4.7,  this method of Magento\Customer\Model\Session\Proxy::isLoggedIn exsit in the two magento version.  the class do not change, i had check the magento release notes.  why does uct report show me this msg? bug or false positive msg?  

 

 

Hi, everyone,  thanks everyone to help me!!!!

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

View solution in original post

6 Replies

Avatar

Level 2

sometimes magento uct report msg is a false positive? how to confirm?

Avatar

Level 10

The Magento\SalesRule\Model\ResourceModel\Coupon\Usage class is flagged because it is not marked as @api, meaning it is not part of the stable public API and may change in future versions. 

Review the Magento DevDocs for deprecated classes in your target version. If the class is deprecated, use the @api alternative provided in the deprecation notice.

Avatar

Level 2

Thanks for your replay, giuseppebag.

Before i already had review the Magento DevDocs, but i can not find the solution. For example, like those causual three issues in my uct report:

1. Magento\SalesRule\Model\ResourceModel\Coupon\Usage

2. Call method 'Magento\Framework\DB\Adapter\AdapterInterface::rollback' that does not exist on version '2.4.7'

3. Call method 'Magento\Framework\DataObject::canConfigure' that does not exist on version '2.4.7'

 

I am not able to find the alternative solution in Magento DevDocs, the docs donot contain the above issues. i do not if i explain clearly.  Look forward to your reply again.  

 

Avatar

Level 2

Avatar

Correct answer by
Community Advisor

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

Avatar

Level 2

Hi @AmitVishwakarma

You are so kind and patient and professional! I can not know how to thank you. Before now, i am worry about the process of magento upgrade from 2.4.5 to 2.4.7. But now, you tell me a important direction and approach i will follow. 
In the coming three months, i will complete the upgrade, if finished, i will record my whole upgrade process, i will append it in current post to refer for other magento developers. 
Finally, The reply is a great help for me, Thank you very much!!!