Skip to content

escapeHtml use @phpstan-return instead - #5691

Draft
Hanmac wants to merge 7 commits into
OpenMage:mainfrom
Hanmac:escapeHtmlFix
Draft

escapeHtml use @phpstan-return instead#5691
Hanmac wants to merge 7 commits into
OpenMage:mainfrom
Hanmac:escapeHtmlFix

Conversation

@Hanmac

@Hanmac Hanmac commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Description (*)

kinda revert from #5402
looks like the IDE aren't ready yet, so i moved the stuff to @phpstan-return

Related Pull Requests

  • see OpenMage/magento-lts#<issue_number>

Fixed Issues (if relevant)

  • fixes OpenMage/magento-lts#<issue_number>

Manual testing scenarios (*)

  1. ...
  2. ...

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All automated tests passed successfully (all builds are green, SonarCloud checks are not required to merge)

@Hanmac
Hanmac requested a review from sreichel July 16, 2026 15:05
@github-actions github-actions Bot added Component: Core Relates to Mage_Core Component: Adminhtml Relates to Mage_Adminhtml labels Jul 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts PHPDoc return type annotations for various escapeHtml* helpers/wrappers to move conditional return types into @phpstan-return, aiming to keep IDE-friendly @return types while retaining PHPStan precision.

Changes:

  • Replaced conditional @return annotations with @phpstan-return in several escapeHtml*-related methods.
  • Simplified/realigned PHPDoc @param / @return type declarations for IDE consumption.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
app/code/core/Mage/Core/Helper/Abstract.php Moves escapeHtml() conditional typing to @phpstan-return and adjusts the public @return.
app/code/core/Mage/Core/Block/Abstract.php Updates wrapper escapeHtml() PHPDoc to pair IDE-friendly @return with @phpstan-return.
app/code/core/Mage/Adminhtml/Helper/Sales.php Updates escapeHtmlWithLinks() PHPDoc return typing and phpstan return typing split.
app/code/core/Mage/Adminhtml/Block/Sales/Order/View/History.php Updates overridden escapeHtml() PHPDoc return typing split.
app/code/core/Mage/Adminhtml/Block/Sales/Order/Comments/View.php Updates overridden escapeHtml() PHPDoc return typing split.

Comment thread app/code/core/Mage/Core/Helper/Abstract.php
Comment thread app/code/core/Mage/Core/Block/Abstract.php Outdated
Comment thread app/code/core/Mage/Adminhtml/Block/Sales/Order/View/History.php Outdated
Comment thread app/code/core/Mage/Adminhtml/Block/Sales/Order/Comments/View.php Outdated
Comment thread app/code/core/Mage/Adminhtml/Helper/Sales.php Outdated
Hanmac and others added 6 commits July 30, 2026 15:26
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: Adminhtml Relates to Mage_Adminhtml Component: Core Relates to Mage_Core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants