Skip to content

How ignore Deprecated Functionality: Optional parameter $data declared before required parameter

As we know Magento latest version 2.4.5 version is compatible with PHP-8.x. When running setup:di: compile, it throws an exception

Deprecated Functionality: Optional parameter $data declared before required parameter $requiredVarible in file on line 10

I know its coding standing always declares required params before optional params but some of this kind of work was done many years ago, now more than 100 modules and 10,000 + methods have this mistake of optional params declared before required parameters.

Can we ignore this exception? or any quick solution to fix this I have changed 100 files but need too much more work to fix this, I want if any way to bypass this standard(require param before optional param).

Your suggestions will be appreciate,Thanks in advance