Sign in

Romain Canon

@romain-canon.com
68 followers 172 following 92 posts

🐘 PHP developer, OSS enthusiast. github.com/romm mastodon.social/@Romm x.com/Rommsteinz

PostsRepliesMedia
Romain Canon @romain-canon.com · 11/08/2026
I'm working on this project mainly on my spare time, if you do use it please consider sponsoring my OSS work, it keeps me motivated github.com/sponsors/romm Full changelog: github.com/CuyZ/Valinor...
github.com
Sponsor @romm on GitHub Sponsors
000
Romain Canon @romain-canon.com · 11/08/2026
The mapper meets a type it cannot parse yet? Override it with `@valinor-var`, `@valinor-param` or `@valinor-return`. PHPStan and Psalm keep using their own annotations.
PHP code showing a phpstan-param annotation with a conditional type, and a valinor-param annotation overriding it with int or null.
100
Romain Canon @romain-canon.com · 11/08/2026
A `@template` annotation can now declare a default type with `=`. This is what makes templates adoptable incrementally: existing references keep resolving to the default, and can be made more precise later.
PHP code showing a Page class with two templates, TMeta declaring a default type with an equals sign, and comments showing that Page of string falls back to the default.
100
Romain Canon @romain-canon.com · 11/08/2026
Generics now work with PHP internal classes: `ArrayObject`, `ArrayIterator`, the SPL structures, the `Ds` collections… They cannot declare `@template` themselves, so the library ships generic signatures for them.
PHP code mapping an array of sizes to the generic type ArrayObject of string keys and integer values.
100
Romain Canon @romain-canon.com · 11/08/2026
Three new normalizer configurators: `NormalizeKeyTo` renames a key in the output, `NormalizeToSingleValue` flattens single-property objects, and `IgnoreOnNormalization` keeps sensitive data out of the normalized result.
PHP code showing an IgnoreOnNormalization attribute on a password property, which is then absent from the normalized array.
100
Romain Canon @romain-canon.com · 11/08/2026
Map a property from a specific source key with `#[MapFromKey('zipCode')]`. The underlying protocol is open to userland: any attribute declaring a `mapKey()` method and carrying `#[AsConverter]` can remap keys, for instance to strip a prefix shared by several properties.
PHP code showing a MapFromKey attribute feeding the postalCode property from the zipCode source key.
100
Romain Canon @romain-canon.com · 11/08/2026
Scalar value casting, with fine-grained control: cast a single property with `#[MapAsInt]`, `#[MapAsBool]`, `#[MapAsFloat]` or `#[MapAsString]`, or enable casting for one type everywhere with `allowCastingToInteger()` and friends. Strictness stays untouched for everything else.
PHP code showing MapAsInt and MapAsBool attributes casting the string '42' to an integer and 'on' to true during mapping.
100
Romain Canon @romain-canon.com · 11/08/2026
Mapper configurators now come out of the box: `MapToDateTimeFromFormat`, `MapExplodedStringToList`, `MapArrayToList` and `MapFromJson`. Use them globally with `configureWith()`, or locally as an attribute on a single property.
PHP code showing a MapToDateTimeFromFormat attribute on a DateTimeInterface property, and a mapper call turning the string '08/11/1971' into a date.
100
Romain Canon @romain-canon.com · 11/08/2026
🔔 Valinor 2.6.0 is out! #PHP This release is packed: provided mapper configurators, scalar value casting, key remapping, new normalizer configurators, generics for PHP internal classes, default types for templates, and more. ⤵️
Release card titled Valinor 2.6.0 with the Valinor logo, describing the library as a PHP library that maps any input into a strongly-typed structure, and listing the highlights: provided mapper configurators, scalar value casting, mapping from a specific key, new normalizer configurators, generics of PHP internal classes, default types for templates, and overriding an unparseable type.
120
Romain Canon @romain-canon.com · 03/07/2026
🤩
010
Reposted by Romain Canon
Thomas Jarrand @tom32i.bsky.social · 03/07/2026
Sur les bons conseils de l'ami @romain-canon.com j'ai codé 4 petits bots pour curvytron2.com et c'est très fun haha
221
Romain Canon @romain-canon.com · 29/06/2026
🚀 #PHP object-mapper library Valinor v2.5.0 released! - Normalizer configurators support (datetime format, camelCase, …) - Shaped list type support — `list{string, int, ...<non-empty-string>}` - `key-of<T>` support - and more! Check out the release page for more info: github.com/CuyZ/Valinor...
github.com
Release 2.5.0 · CuyZ/Valinor
Notable changes This release brings a set of new features to the library: Normalizer configurators support Shaped list type support key-of type support and more! Enjoy! 🎉 Normalizer configurator...
000
Romain Canon @romain-canon.com · 03/06/2026
The reason GitHub uptime is bad these days: they do a lot of renovation work.
A building under renovation, with a facade covered in green mosaics that looks like a GitHub contribution graph.
011
Romain Canon @romain-canon.com · 25/05/2026
Woops, le ping n'a pas l'air d'avoir fonctionné, cc @afup.org 😅
110
Romain Canon @romain-canon.com · 25/05/2026
Prochaine étape : rapprochez-vous de l'antenne AFUP la plus proche afup.org/association/... ; participez aux meetups et prenez votre place pour le forum, vous ne le regretterez pas 😊 : event.afup.org À bientôt, on se voit au forum j'espère 😁
000
Romain Canon @romain-canon.com · 25/05/2026
L'Open Source et les projets qui en découlent sont éminemment politiques ; le message est clair : placer l'Humain au cœur du développement, favoriser le partage plutôt que la compétition. J'y crois dur comme fer, je ne suis pas le seul, et j'aimerais beaucoup qu'on soit plus nombreux.
100
Romain Canon @romain-canon.com · 25/05/2026
Et pourtant la solution est simple : continuer de soutenir ces structures en participant à leurs événements, et surtout en partageant à vos amis, collègues, supérieurs, etc. — participer à ces rassemblements, c'est TOUJOURS enrichissant.
100
Romain Canon @romain-canon.com · 25/05/2026
C'est aussi la bonne occasion de rappeler que tout ça n'est pas acquis, et que ce modèle est dores et déjà en danger. L'AFUP fait partie de ces associations qui souffrent cruellement des changements qui opèrent dans notre milieu ces dernières années.
100
Romain Canon @romain-canon.com · 25/05/2026
Encore un grand merci, un grand bravo aux bénévoles de l'AFUP, ainsi qu'à Amélie Deffrennes qui chapeaute tout ça ! C'est une communauté en or, un regroupement de gens bienveillants, qui viennent pour apprendre *et* partager.
100
Romain Canon @romain-canon.com · 25/05/2026
Vendredi dernier avait lieu l'@afup.org Day : une journée de conférences en simultané à Bordeaux, Lille, Lyon et Paris. J'ai eu la chance de pouvoir présenter à Lille ma conférence « Test simplifié à moitié pardonné » — vous pouvez retrouver les slides ici : romm.github.io/test-simplif...
Photo de moi sur scène présentant la conférence « Test simplifié à moitié pardonné »
241
Romain Canon @romain-canon.com · 13/05/2026
Thank you @acelaya.com for sponsoring my OSS work, I'm glad you're making use of it! 🤗
010
Romain Canon @romain-canon.com · 07/05/2026
I think I was misunderstood. I do not blame you for continuing to post things on Twitter; I understand this is a professional tool and not everyone can easily abandon their audience. What I'm concerned about is the "no politics" stance. Saying that *is* political and, IMO, very problematic.
000
Romain Canon @romain-canon.com · 07/05/2026
This can not, IMO, be completely ignored by people who are in charge of leading PHP. And I think you are part of these people. You are a wonderful guy, that's why I can't ignore your post and stay silent (FWIW I think that's the first time I disagree with something you said 😊).
100
Romain Canon @romain-canon.com · 07/05/2026
Thank you Brent, I forgot about this blog post, which I read when it was posted. Great content, as always. I'm not talking about the kind of content that flooded X at that time, though; I was talking about far-right political stands of the platform, which led to the rise of fascist ideology.
100
Romain Canon @romain-canon.com · 07/05/2026
Or *AT LEAST*, pretty please, stop spreading these kind of words. It hurts people who are already made invisible. I love what you do, I always have. Please, be more political, use your audience to help them instead of ignoring them.
000
Romain Canon @romain-canon.com · 07/05/2026
Nothing is apolitical, *especially* not PHP which has always followed a path to ensure everyone is included. PHP should post on X? Right — then BE political, take firm stance against abusive behaviors that made minorities flee from here.
100
Romain Canon @romain-canon.com · 07/05/2026
“[…] and I think we should leave politics at home and be where people are” A lot of people ran away from X for very good reasons. Do not act like they did it *just* because they wanted to, they did it because their mental health was in danger (insults, threats, …).
201
Romain Canon @romain-canon.com · 06/05/2026
Venez partager un chouette moment le vendredi 22 mai prochain à Lille ! Il reste encore des places. 😊
033
Romain Canon @romain-canon.com · 21/04/2026
Valinor — #PHP object mapping library — has recently crossed 10 million downloads on Packagist! I'm really proud of what it means: more and more #PHP developers are eager for stricter codebases, which is a great achievement. 🎉 Haven't heard of it yet? Check it out! github.com/CuyZ/Valinor
030
Romain Canon @romain-canon.com · 01/04/2026
⚡
000
Romain Canon @romain-canon.com · 01/04/2026
Ouiiiiiiiiiiiii 🤩 Félicitations et bravo 🍅❤️
010
Reposted by Romain Canon
Thomas Jarrand @tom32i.bsky.social · 01/04/2026
Imaginez 10 ans plus tard je sors une suite à Curvytron et je l’annonce un 1er avril ? Nan je rigole. Mais imaginez quand même : curvytron2.com
31611
Romain Canon @romain-canon.com · 23/03/2026
Grab it while it's hot 🔥 `composer require cuyz/valinor:^2.4.0` I maintain this OSS project on my spare time — if you want to ensure its future, please consider sponsoring my work 🤗 github.com/sponsors/romm
github.com
Sponsor @romm on GitHub Sponsors
001
Romain Canon @romain-canon.com · 23/03/2026
✨ We also got you covered for when you want to enforce the key case… ⤵️
Code snippet that shows how to use Valinor's case restriction configurators
101
Romain Canon @romain-canon.com · 23/03/2026
✨ And the first configurators provided out of the box are the case conversion configurators: automatically convert source keys to `camelCase` or `snake_case` formats! ⤵️
Code snippet that shows how to use Valinor's case conversion configurators
101
Romain Canon @romain-canon.com · 23/03/2026
🔥 This release also brings support for mapper/normalizer configurators: reusable piece of configuration logic. This is useful when the same configuration needs to be applied in multiple places across an application, or when configuration logic needs to be distributed as a package. ⤵️
Code snippet that shows how to use Valinor's mapper configuratorsCode snippet that shows how to use Valinor's normalizer configurators
101
Romain Canon @romain-canon.com · 23/03/2026
The awesome @ocramius.mastodon.social.ap.brid.gy has been working on a native integration with Mezzio! This means being able to *very easily* map PSR-7 requests to strictly-typed objects! Look at the example below to see how trivial it becomes. More info: github.com/mezzio/mezzi... ⤵️
Code snippet that shows how to use HTTP request mapping with Mezzio
100
Romain Canon @romain-canon.com · 23/03/2026
The Symfony bundle has been updated to support this feature out of the box! More info: github.com/CuyZ/Valinor... ⤵️
Code snippet that shows how to use HTTP request mapping with Symfony
101
Romain Canon @romain-canon.com · 23/03/2026
This feature contains several parts: - Attributes to enforce route/query/body source - Mapping a whole query/body to single parameter - Mapping the HTTP request to an object - PSR-7 support - And of course, advanced types support and strict error handling with human-readable messages ⤵️
101
Romain Canon @romain-canon.com · 23/03/2026
🔥 HTTP request mapping Valinor now provides a way to map an HTTP request to controller parameters or object properties. This gives controllers a clean, type-safe signature without coupling to a framework's request object, while benefiting from the library's validation and error handling. ⤵️
101
Romain Canon @romain-canon.com · 23/03/2026
🔔 #PHP object-mapper library Valinor v2.4.0 released! 🚀 This huge release brings exciting new features: - Out of the box HTTP request mapping - Mapper/normalizer configurators - CamelCase/snake_case keys conversion - Keys case restriction github.com/CuyZ/Valinor... ⤵️ see below for more details ⤵️
110
Reposted by Romain Canon
Seifeddine / ⵙⵢⴼ 🐘 🦀 @carthage.software · 18/03/2026
PSL 6.0 is out. 🎉 PHP Standard Library is now split into 61 standalone packages. Install only what you need: $ composer require php-standard-library/async No more pulling in 60 packages when you just need one. github.com/php-standard-library/php-standard-library/releases/tag/6.0.0 #php #psl
github.com
Release Hevlaska 6.0.0 · php-standard-library/php-standard-library
PSL 6.0.0 PSL 6.0 is the biggest release in the project's history. New home, new packages, new capabilities. A new home PSL has moved. The repository, the organization, the website - everything has...
022
Reposted by Romain Canon
AFUP @afup.org · 17/03/2026
Fêter 25 ans ensemble, c'était beau. Mais 2026 s'annonce difficile pour l'AFUP. Sponsors en retrait, billetteries en recul… Sans la communauté, il n'y a pas d'AFUP. On vous explique nos difficultés dans cet article, et on compte sur vous ! 💙 buff.ly/sh1OMTU
25 ans à fédérer la communauté PHP en France...
Mais ce début d'année 2026 nous inquiète. Vraiment.
01121
Romain Canon @romain-canon.com · 23/02/2026
Thanks you @mopolo.dev for helping out!
000
Romain Canon @romain-canon.com · 23/02/2026
🚚 The `.io` domain names have become really expensive over the past couple of years, so I’ve decided to move the #PHP Valinor documentation from valinor.cuyz.io to valinor-php.dev
102
Romain Canon @romain-canon.com · 23/01/2026
🔔 #PHP object-mapper library Valinor v2.3.2 released! Mainly a bug-fix release, with 2 notable changes: - End of PHP 8.1 support (support ended in December 2025) - Removal of `composer-runtime-api` requirement, making this library completely dependency free. 🎉 github.com/CuyZ/Valinor...
github.com
Release 2.3.2 · CuyZ/Valinor
Notable changes End of PHP 8.1 support PHP 8.1 security support has ended on the 31st of December 2025. See: https://www.php.net/supported-versions.php Removal of composer-runtime-api package depen...
000
Romain Canon @romain-canon.com · 07/01/2026
Coucou Lille, on se voit le 22 mai pour parler de tests ? 🤗
031
Romain Canon @romain-canon.com · 18/12/2025
Just updated my profile picture, after more than a decade with the old one everywhere on the web! It feels weird but refreshing 😅
020
Romain Canon @romain-canon.com · 20/11/2025
And now @packagist.com 🔥 Thank you so much for sponsoring my work and placing trust in my humble contribution to the PHP ecosystem! 🙏
141
Romain Canon @romain-canon.com · 20/11/2025
✨ Thank you @pscheit.bsky.social for the generous sponsoring, which allows me to spend more time on Valinor! OSS community is the best! 🚀 github.com/CuyZ/Valinor...
github.com
GitHub - CuyZ/Valinor: PHP library that helps to map any input into a strongly-typed value object structure.
PHP library that helps to map any input into a strongly-typed value object structure. - CuyZ/Valinor
120