Skip to content

phpStan: update escapeHtml() docs - #5609

Open
sreichel wants to merge 5 commits into
OpenMage:mainfrom
sreichel:phpstan/escapeHtml-2
Open

phpStan: update escapeHtml() docs#5609
sreichel wants to merge 5 commits into
OpenMage:mainfrom
sreichel:phpstan/escapeHtml-2

Conversation

@sreichel

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings May 22, 2026 15:49
@sreichel sreichel added the chore label May 22, 2026
@github-actions github-actions Bot added Component: Core Relates to Mage_Core phpstan labels May 22, 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 updates the PHPStan/PHPDoc typing for Mage_Core_Block_Abstract::escapeHtml() and refreshes the PHPStan baseline files accordingly, with the goal of improving static analysis signal around HTML escaping usage across blocks and templates.

Changes:

  • Updated escapeHtml() PHPDoc in Mage_Core_Block_Abstract to use a template-based, argument-dependent return type.
  • Regenerated/updated PHPStan baselines, removing many now-unneeded ignores and adding new ignores introduced by the template-based PHPDoc.

Reviewed changes

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

Show a summary per file
File Description
app/code/core/Mage/Core/Block/Abstract.php Adjusts escapeHtml() PHPDoc to change PHPStan’s inferred parameter/return types.
.phpstan.dist.baselines/return.type.php Removes several previously needed ignores after type inference changes.
.phpstan.dist.baselines/offsetAccess.nonOffsetAccessible.php Updates ignore message text to match new inferred types.
.phpstan.dist.baselines/offsetAccess.invalidOffset.php Removes an ignore that is no longer triggered.
.phpstan.dist.baselines/method.childParameterType.php Adds ignores for new contravariance findings related to escapeHtml() overrides.
.phpstan.dist.baselines/if.condNotBoolean.php Updates ignore messages/counts after type inference changes.
.phpstan.dist.baselines/encapsedStringPart.nonString.php Removes ignores no longer triggered due to updated escapeHtml typing.
.phpstan.dist.baselines/elseif.condNotBoolean.php Adds/adjusts ignores to match updated analysis results.
.phpstan.dist.baselines/echo.nonString.php Large baseline refresh reflecting new inferred types for echo expressions.
.phpstan.dist.baselines/binaryOp.invalid.php Removes ignores no longer triggered due to updated typing.
.phpstan.dist.baselines/assignOp.invalid.php Removes an ignore no longer triggered due to updated typing.
.phpstan.dist.baselines/argument.type.php Removes many ignores no longer triggered due to updated typing.
.phpstan.dist.baselines/argument.templateType.php Adds a new baseline file to ignore template-type resolution errors.
.phpstan.dist.baselines/_loader.php Includes the new argument.templateType.php baseline file.

Comment thread app/code/core/Mage/Core/Block/Abstract.php
Comment thread .phpstan.dist.baselines/method.childParameterType.php
Comment thread .phpstan.dist.baselines/argument.templateType.php Outdated
@github-actions github-actions Bot added Template : base Relates to base template Component: Shipping Relates to Mage_Shipping labels May 22, 2026
@github-actions github-actions Bot added the Component: Customer Relates to Mage_Customer label May 22, 2026
@sonarqubecloud

Copy link
Copy Markdown

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

Labels

chore Component: Core Relates to Mage_Core Component: Customer Relates to Mage_Customer Component: Shipping Relates to Mage_Shipping phpstan Template : base Relates to base template

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants