This repository was archived by the owner on Dec 15, 2025. It is now read-only.
Repository navigation
This major release introduces a new namespace, a full internationalization system, and powerful features for validating HTTP requests, headers, and forms.
BREAKING CHANGE: The root namespace has been changed from PhpDevCommunity\RequestKit to Depo\RequestKit. All use statements in projects using this library must be updated.
Features:
HTTP Request Handling:
withHeaders(): A new method inAbstractSchemato define validation rules for incoming HTTP headers (e.g., API keys, Content-Type).processFormHttpRequest(): A new method inAbstractSchemato securely process form submissions.- CSRF Protection: The
processFormHttpRequestmethod includes optional, secure CSRF token validation to prevent cross-site request forgery attacks.
Core Validation:
equals(): A generic constraint has been added toAbstractType, allowing any data type to be checked for strict equality against a specific value.
Internationalization (i18n):
- A new
Localeclass now manages all error messages, allowing for easy translation. - The library now ships with built-in translations for English ('en') and French ('fr').
Improvements & Fixes:
- Security: The error message for the
equals()constraint no longer reveals the expected value, preventing potential secret leakage. - Refactoring: The entire library has been moved under the
Depovendor namespace for better project identity. - Dependency Removal: The dependency on
phpdevcommunity/validatorhas been removed, making the library fully self-contained. - Testing: Added comprehensive unit tests for all new features, including
equals,withHeaders,processFormHttpRequest, and theLocalesystem. - Documentation: The
README.mdhas been significantly updated with examples and explanations for all new features.