Back to Vol 22, Issue 3

PHP Architect · Vol 22, Issue 3 · March 2023

PSR Pickup: PSR-17: HTTP Factories

by Frank Wallen

In PHPArchitect Issue 7 of Volume 21 (way back in July 2022), I wrote about PSR-7: Message Interfaces, where Request and Response interfaces were defined to ensure that requests and responses were properly structured and handled. PSR-17 was created to support PSR-7 by defining interfaces for factories to create HTTP objects. The factory design pattern is an excellent way to introduce standards in components not specifically implementing PSR-7 interfaces. They will produce the request and response objects following the recommended standards, and the implementing code will not require a major refactor. PSR-7 was written before the release of PHP 7; therefore, following these recommended standards is important for security and stability.

The full article is in PHP Architect Vol 22, Issue 3. Subscribe to read it and every new issue.

Subscribe
Frank Wallen

About the author

Frank Wallen

Frank Wallen is a PHP developer, musician, and tabletop gaming geek (really a gamer geek in general). He is also the proud father of two amazing young men and grandfather to two beautiful children who light up his life. He is from Southern and Baja California and dreams of having his own Rancherito where he can live with his family, have a dog, and, of course, a cat.

Our Partners

Collaborating with industry leaders to bring you the best PHP resources and expertise

Interested in partnering? Get in touch →