_(Re-reporting an issue with even simpler steps)_
This report addresses an issue that has been talked about before, but has not yet received a solution that would be viable in the long run as the focus has been mostly on making sure that Magento2 code does not use certain PHP7 features rather than making Framework fully capable of supporting all that PHP7 has to offer.
Therefore the description has been written in a form where existing code is manipulated with to make sure that there's no way to perceive this as a issue that deserves a solution of removing the appearance of the problem (which is fine as an isolated containment of the issue but I would humbly advise against closing the ticket based on said containment).
Same issue reported in different scenarios in:
https://github.com/magento/magento2/issues/24443
https://github.com/magento/magento2/issues/22769
https://github.com/magento/magento2/issues/23084
https://github.com/magento/magento2/issues/11905
This issue created on purpose to have an open issue on this topic as all that were previously reported have since been closed (with "fixed" flag).
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT_(this guide has been written and tested by following ONLY the steps provided with no manual/custom actions taken)_
Use any Magento release (report based on 2.3.2, which at the time of reporting was the latest release), sample data not needed.
composer create-project magento/community-edition issue-24475
cd issue-24475
bin/magento module:enable --all
_(All actions performed in terminal, re-creating issue that was hidden away with the change HERE)_
Modify Magento\Framework\HTTP\PhpEnvironment\Response :: setHeader method by adding a 'self' return type to it:
sed -i \
's/\(ion setHeader(.*\)/\1: self/g' \
lib/internal/Magento/Framework/HTTP/PhpEnvironment/Response.php
Trigger聽code generation with:
bin/magento setup:di:compile
The code generation command finishes without issues
Proxy (_generated/code/Magento/Framework/Webapi/Rest/Response/Proxy.php_)聽reads:
setHeader(
$name,
$value,
$replace = false
) : \Magento\Framework\HTTP\PhpEnvironment\Response
Fatal error: Declaration of
Magento\Framework\Webapi\Rest\Response\Proxy::setHeader(
$name,
$value,
$replace = false
): Magento\Framework\Webapi\Rest\Response
must be compatible with
Magento\Framework\HTTP\PhpEnvironment\Response::setHeader(
$name,
$value,
$replace = false
): Magento\Framework\HTTP\PhpEnvironment\Response
setHeader(
$name,
$value,
$replace = false
) : \Magento\Framework\Webapi\Rest\Response
Hi @allanpaiste. Thank you for your report.
To help us process this issue please make sure that you provided the following information:
Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:
@magento give me 2.3-develop instance - upcoming 2.3.x release
For more details, please, review the Magento Contributor Assistant documentation.
@allanpaiste do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?
Hi @engcom-Charlie. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.
[ ] 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.
[ ] 4. Verify that the issue is reproducible on 2.3-develop branchDetails
- Add the comment @magento give me 2.3-develop instance to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!
[ ] 5. Add label Issue: Confirmed once verification is complete.
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
If this one also gets closed, then I will give up ;)
@allanpaiste i confirm this issue, thanks for contributing!
:white_check_mark: Confirmed by @engcom-Charlie
Thank you for verifying the issue. Based on the provided information internal tickets MC-19911 were created
Issue Available: @engcom-Charlie, _You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself._
Hi @EugenMerzhka. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:
Component: XXXXX label(s) to the ticket, indicating the components it may be related to.[ ] 2. Verify that the issue is reproducible on 2.3-develop branchDetails
- Add the comment @magento give me 2.3-develop instance to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!
[ ] 3. If the issue is not relevant or is not reproducible any more, feel free to close it.
I have no time to properly test this, but I am 99% sure this would fix this issue:
https://github.com/magento/magento2/issues/22769#issuecomment-499387177