Romain Canon

@Romm
122 Followers
89 Following
266 Posts
🐘 PHP developer, OSS enthusiast
Githubhttps://github.com/romm/
Bluesky@romain-canon.com
Twitter@Rommsteinz

The PHP internals team has voted 38–4 to deprecate all OOP constructs in PHP 9.0.

Reason: LLMs produce 34% fewer errors on procedural codebases. SOLID principles cause context overload in 78% of tested models. `__construct()` is the #1 source of LLM hallucinations in PHP.

#laravel and #symfony are assessing their roadmaps. WordPress is already compatible.

How are you preparing your codebase?

#php #oop #ai

New on the blog: Type-safe request parsing with mezzio-valinor by @ocramius!

https://roave.com/type-safe-request-parsing-with-mezzio-valinor/

Roave - Type-safe request parsing with mezzio-valinor

Roave

Released: @getlaminas mezzio/mezzio-valinor:1.0.0

https://github.com/mezzio/mezzio-valinor/releases/tag/1.0.0

This is based on @Romm's work on Valinor 2.4.0, allowing for easy mapping of PSR-7 request attributes \o/

Release 1.0.0 - first stable release · mezzio/mezzio-valinor

What's Changed Initial setup of the component by @Ocramius in #1 Expanding mapper to understand BODY, QUERY, ROUTE parameter extraction by @Ocramius in #4 New Contributors @Ocramius made their f...

GitHub

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 🤗

https://github.com/sponsors/romm

Sponsor @romm on GitHub Sponsors

GitHub is where people build software. More than 150 million people use GitHub to discover, fork, and contribute to over 420 million projects.

GitHub

✨ We also got you covered for when you want to enforce the key case…

⤵️

✨ And the first configurators provided out of the box are the case conversion configurators: automatically convert source keys to `camelCase` or `snake_case` formats!

⤵️

🔥 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.

The awesome @ocramius 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: https://github.com/mezzio/mezzio-valinor

⤵️

The Symfony bundle has been updated to support this feature out of the box!

More info: https://github.com/CuyZ/Valinor-Bundle#http-request-mapping

⤵️

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

⤵️