Add WAF conditions validator#4
Conversation
Greptile SummaryThis PR introduces
Confidence Score: 5/5The change is additive (new class + tests, no modifications to existing logic) and the validator correctly handles all the edge cases addressed in prior review rounds. All previously identified edge cases — type errors on unexpected element types, empty logical condition values, missing payload-length checks on array inputs, and nested condition counting — are now handled in the implementation and exercised by the new test suite. No new defects were found in this pass. No files require special attention. Important Files Changed
Reviews (4): Last reviewed commit: "Guard condition payload types" | Re-trigger Greptile |
Summary
Utopia\WAF\Validator\Conditionsfor validating WAF rule condition payloads at API boundariesCondition::toArray()and encoded condition strings fromCondition::encode()Scope
This is a WAF-domain validator intended for request parameter validation before rules are persisted. Runtime rule evaluation remains outside this validator.
Validation
composer testphp vendor\bin\pint --testphp vendor\bin\phpstan analyse -c phpstan.neon --memory-limit 512MNote:
composer lintandcomposer checkusevendor/bin/...paths that did not resolve for Pint/PHPStan in this Windows shell, so the equivalentphp vendor\bin\...commands were run directly.