[Issue] Support the use of PHP 8.0 "mixed" type #35579
Labels
Area: Framework
Component: Module
Issue: Confirmed
Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed
Priority: P2
A defect with this priority could have functionality issues which are not to expectations.
Progress: done
Reported on 2.4.4
Indicates original Magento version for the Issue report.
Reproduced on 2.4.x
The issue has been reproduced on latest 2.4-develop branch
Severity: S1
Affects critical data or functionality and forces users to employ a workaround.
Projects
This issue is automatically created based on existing pull request: #35572: Support the use of PHP 8.0 "mixed" type
Currently Magento does not compile when using the
mixed
type, neither as a parameter or return type. The generated Interceptor / Proxy / etc. classes try to make this union type nullable (?mixed
). This will result in a fatal PHP error since the union type already includesnull
, andnull
is not nullable.During compilation you will be encountered with the following error:
Type "mixed" cannot be nullable
This patch checks if the type is
mixed
before adding the nullable (?
) prefix.The text was updated successfully, but these errors were encountered: