Valinor is a must-have library for #PHP + PSR-15 based development.

It lives at the edge of your graph, between user input and your DTOs, and runs circles around all other (de-)serialization libraries out there: it's just built with @phpstan / @psalm types at its core, reducing mapping code massively, keeping type safety central.

Glad to see this getting a new major release!

https://mastodon.social/@Romm/114754020085694743

See also
https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-validate/

Parse, don’t validate

@ocramius @phpstan @psalm

I've not used valinor but did end up going with another object hydrator because it used attributes to markup DTO properties instead of annotations.

I'm not sure it's that big of a deal but really that should be the default now right?

@pieceofthepie valinor does not use annotation nor attributes: only type inference :-)

You can use attributes, but I would discourage that.

@ocramius oh, the type reference docs page suggests otherwise?

@pieceofthepie ah, just a misunderstanding in what we define as annotations.

* `@ validate("some-rule")` would be an annotation
* `#[Validate("some-rule")]` would be an attribute
* `@ param list<int<5, 25>>` is a type declaration (not an annotation)