Skip to content

Relax consumer-a's export lock through the filter's own value - #63

Merged
ahegyes merged 1 commit into
trunkfrom
refactor/consumer-a-relaxation
Oct 28, 2026
Merged

ahegyes merged 1 commit into
trunkfrom
refactor/consumer-a-relaxation

Conversation

@ahegyes

@ahegyes ahegyes commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Summary. consumer-a's relaxation helper took the safeguard's filter name and called apply_filters() with it, so the export lock's hook had no literal call to document and PHPStan checked none of its arguments. ahegyes/wordpress-plugin-template#18's safeguard recipe, which consumer-a mirrors, takes the filter's value instead.

  • Helper: acme_ca_is_relaxed( $filtered ) returns whether an explicit false came back once the plugin has booted, and the export lock calls it around its literal apply_filters( 'acme_ca_restrict_exports', true ), documented in place.

Fixtures +13 −8 (1 file).

Review points.

  • The helper's parameter is typed by docblock only, because includes/safeguards.php loads before the floor check and parses on PHP 7.4.

Testing.

  • composer quality-check passes: validate, changelog validation, PHPCS on both profiles, the PHPStan profiles and every fixture's, Unit 189 and Integration 1333, with ConsumerASafeguardTest's SG1 rows unchanged.
  • The file parses on php:7.4-cli.

consumer-a's acme_ca_is_relaxed() took the safeguard's filter name and
called apply_filters() with it, so the export lock's hook had no
literal call for its docblock, and PHPStan checked none of its
arguments. The template's safeguard recipe, which consumer-a mirrors,
now takes the filter's value instead (T4 pre-build ruling 5).

acme_ca_is_relaxed() takes the filtered value, and the export lock
calls it around its literal apply_filters( 'acme_ca_restrict_exports',
true ), documented in place. SG1's rows pass unchanged.

Assisted-by: Claude Code:claude-opus-5-5
@ahegyes
ahegyes merged commit a609f5a into trunk Oct 28, 2026
23 checks passed
@ahegyes
ahegyes deleted the refactor/consumer-a-relaxation branch October 28, 2026 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant