|
| 1 | +# Lemmon Validator - Roadmap |
| 2 | + |
| 3 | +This roadmap outlines the planned features for future releases, prioritizing commonly needed functionalities for application development. |
| 4 | + |
| 5 | +**Released:** |
| 6 | +- `0.1.0` - Initial release. |
| 7 | + |
| 8 | +## Release 0.2: Common Formats & Utility Constraints |
| 9 | + |
| 10 | +This release focuses on introducing highly practical format validators for strings and other frequently used utility constraints. |
| 11 | + |
| 12 | +* **StringValidator**: |
| 13 | + * Implement `email()`: Validates a string as an email address. |
| 14 | + * Implement `url()`: Validates a string as a URL. |
| 15 | + * Implement `uuid()`: Validates a string as a UUID. |
| 16 | + * Implement `ip()`: Validates a string as an IPv4 or IPv6 address. |
| 17 | + * Implement `datetime()`: Validates a string as a date-time format (e.g., ISO 8601). |
| 18 | + * Implement `date()`: Validates a string as a date format. |
| 19 | + * Implement `time()`: Validates a string as a time format. |
| 20 | +* **NumberValidator**: |
| 21 | + * Implement `isFloat()` / `isNumber()`: For floating-point numbers. |
| 22 | + * Implement `multipleOf(float $value)`: Validates that a number is a multiple of a given number. |
| 23 | +* **ArrayValidator**: |
| 24 | + * Implement `uniqueItems(bool $unique = true)`: Validates that all items in an array are unique. |
| 25 | +* **Enum & Const**: |
| 26 | + * Implement `enum(array $allowedValues)`: Validates that a value is one of a predefined set of values (for all `FieldValidator` types). |
| 27 | + * Implement `const(mixed $constantValue)`: Validates that a value is exactly equal to a specific constant. |
| 28 | + |
| 29 | +## Release 0.3: Advanced Structure & Relationships |
| 30 | + |
| 31 | +This release introduces more sophisticated validation rules for complex data structures and their interdependencies. |
| 32 | + |
| 33 | +* **SchemaValidator (Object Properties)**: |
| 34 | + * Implement `additionalProperties(FieldValidator|bool $validatorOrBoolean)`: Controls whether properties not explicitly defined in the schema are allowed, and optionally validates them against a subschema. |
| 35 | + * Implement `patternProperties(array $regexToValidatorMap)`: Validates properties whose names match a given regular expression against a subschema. |
| 36 | + * Implement `propertyNames(StringValidator $validator)`: Validates the names of all properties in an object against a string schema. |
| 37 | + * Implement `dependencies(array $dependencies)`: Defines conditional validation based on the presence or value of other properties. |
| 38 | +* **ArrayValidator**: |
| 39 | + * Implement `contains(FieldValidator $validator)`: Validates that an array contains at least one item that matches a given subschema. |
| 40 | + * Implement `additionalItems(FieldValidator|bool $validatorOrBoolean)`: Controls whether items beyond those defined in `items` (when `items` is an array of schemas) are allowed, and optionally validates them. |
| 41 | + |
| 42 | +## Release 0.4: Logical Combinators |
| 43 | + |
| 44 | +This release introduces the powerful logical combinators for expressing complex validation rules. |
| 45 | + |
| 46 | +* **Combinators (New `Combinator` class or methods on `FieldValidator`)**: |
| 47 | + * Implement `allOf(array $validators)`: Value must be valid against all provided subschemas. |
| 48 | + * Implement `anyOf(array $validators)`: Value must be valid against at least one of the provided subschemas. |
| 49 | + * Implement `not(FieldValidator $validator)`: Value must *not* be valid against the provided subschema. |
| 50 | + |
| 51 | +## Ongoing Tasks (Across All Releases) |
| 52 | + |
| 53 | +* **Documentation**: |
| 54 | + * Maintain comprehensive PHPDoc comments for all new and existing methods/properties. |
| 55 | + * Continuously update `README.md` with new usage examples. |
| 56 | + * Develop a dedicated "Advanced Usage" guide or wiki for complex features. |
| 57 | +* **Testing**: |
| 58 | + * Maintain high unit test coverage for all new features. |
| 59 | + * Implement integration tests for complex schema interactions (e.g., nested schemas, combinators). |
| 60 | + * Consider property-based testing for robust validation. |
| 61 | +* **Performance Optimization**: |
| 62 | + * Regularly profile and optimize critical validation paths, especially for large schemas or inputs. |
| 63 | +* **Error Reporting**: |
| 64 | + * Continuously refine error messages and error paths for complex nested validations to ensure they are clear and actionable. |
| 65 | +* **Type Safety**: |
| 66 | + * Leverage PHP's type system and static analysis (PHPStan) to ensure maximum type safety throughout the library. |
0 commit comments