Skip to content
This repository was archived by the owner on Dec 15, 2025. It is now read-only.

Releases: michelphp/php-requestkit

Release v2.0.0 - HTTP validation, i18n, and namespace change

Choose a tag to compare

@michelphp michelphp released this 07 Dec 18:26

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 in AbstractSchema to define validation rules for incoming HTTP headers (e.g., API keys, Content-Type).
  • processFormHttpRequest(): A new method in AbstractSchema to securely process form submissions.
  • CSRF Protection: The processFormHttpRequest method includes optional, secure CSRF token validation to prevent cross-site request forgery attacks.

Core Validation:

  • equals(): A generic constraint has been added to AbstractType, allowing any data type to be checked for strict equality against a specific value.

Internationalization (i18n):

  • A new Locale class 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 Depo vendor namespace for better project identity.
  • Dependency Removal: The dependency on phpdevcommunity/validator has been removed, making the library fully self-contained.
  • Testing: Added comprehensive unit tests for all new features, including equals, withHeaders, processFormHttpRequest, and the Locale system.
  • Documentation: The README.md has been significantly updated with examples and explanations for all new features.

fix ItemType validator

Choose a tag to compare

@michelphp michelphp released this 28 Oct 08:49
1.0.5

fix ItemType validator

feat(schema): add support for Type::map() to validate key-value objects

Choose a tag to compare

@michelphp michelphp released this 12 May 10:50

add support for Type::map() to validate key-value objects

feat(arrayof): allow optional acceptance of string keys

Choose a tag to compare

@michelphp michelphp released this 25 Apr 09:32

Added support for string keys in ArrayOf types via acceptStringKeys() method.
By default, keys must be integers. When enabled, string keys are trimmed and accepted.

Add allowEmptyData option to validation processor

Choose a tag to compare

@michelphp michelphp released this 01 Apr 15:36
  • Add allowEmptyData parameter to process() method
  • Skip validation when empty data is explicitly allowed
  • Maintain backward compatibility with default false value

Support psr/http-message 1.0+2.0

Choose a tag to compare

@michelphp michelphp released this 01 Apr 13:28

Update dependency constraint to "^1.0 || ^2.0"

Initial commit for php-requestkit library

Choose a tag to compare

@michelphp michelphp released this 01 Apr 13:20
1.0.0

Initial commit for php-requestkit library