Repository navigation
Relax consumer-a's export lock through the filter's own value - #63
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.acme_ca_is_relaxed( $filtered )returns whether an explicitfalsecame back once the plugin has booted, and the export lock calls it around its literalapply_filters( 'acme_ca_restrict_exports', true ), documented in place.Fixtures +13 −8 (1 file).
Review points.
includes/safeguards.phploads before the floor check and parses on PHP 7.4.Testing.
composer quality-checkpasses: validate, changelog validation, PHPCS on both profiles, the PHPStan profiles and every fixture's, Unit 189 and Integration 1333, withConsumerASafeguardTest's SG1 rows unchanged.php:7.4-cli.