A dependency-free PHP library that maps raw inputs like JSON and arrays into strongly-typed objects with validation.
Valinor is a PHP library that constructs and validates raw inputs like JSON or arrays into strongly-typed objects, ensuring data integrity throughout an application's lifecycle. It provides precise, human-readable error messages for invalid values and supports advanced type systems used by static analyzers. The library also includes a normalization mechanism to transform inputs into formats like JSON or CSV while preserving structure.
PHP developers building applications that require robust data validation and type-safe object mapping from external inputs, such as APIs, configuration files, or user submissions. It is particularly useful for teams using static analysis tools like PHPStan or Psalm to enforce complex type constraints.
Developers choose Valinor over alternatives because it eliminates manual validation boilerplate, supports advanced PHP types (e.g., generics, shaped arrays, integer ranges) without external dependencies, and delivers clear error messages that simplify debugging. Its focus on reliability and developer experience ensures type-safe data handling with minimal integration overhead.
Dependency free PHP library that helps to map any input into a strongly-typed structure.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports complex types used by PHPStan and Psalm, such as generics and shaped arrays, enabling robust static analysis as highlighted in the README.
Provides precise, human-readable validation errors for incorrect values, reducing debugging time, as emphasized in the documentation.
Has no external dependencies, simplifying integration and avoiding conflicts in PHP projects, a key feature noted in the installation section.
Transforms inputs into formats like JSON or CSV while preserving structure, offering versatile data output options as described in the features.
Uses reflection for object mapping, which can introduce runtime overhead, especially with large or nested data structures, compared to manual hydration.
Requires familiarity with PHP docblocks or attributes for advanced types, adding a learning curve for developers not using static analyzers like PHPStan.
Focuses on type-based validation; custom rule logic may require extending core classes, lacking the plug-and-play rules of dedicated validation libraries.