This post originally appeared on Symfony Station.
Welcome to this week's Symfony Station Communiqué. It's your weekly review of the most valuable and essential news in the Symfony and PHP development communities. Take your time and enjoy the items most valuable for you.
Thanks to Javier Eguiluz and Symfony for sharing our last communiqué in their Week of Symfony.
*Please note that links will open in a new browser window. My opinions, if I present any, will be in bold.
Symfony
As always, we will start with the official news from Symfony.
Highlight -> "This week, Symfony released the first versions of the recently open-sourced Symfony CLI project. In addition, Symfony announced the upcoming ending of Early Bird Tickets and Call for Papers period for the SymfonyLive Paris 2022 and SymfonyWorld Online 2022 Summer Edition conferences."
A Week of Symfony #784 (3-9 January 2022)
It's your last chance to get an Early Bird ticket for SymfonyWorld Online 2022 Summer Edition workshops, conference, or combo workshop and conference. The deadline is January 14th, 2022 11:59 pm (Paris time).
Last day of Early Bird registration for SymfonyWorld Online 2022 Summer Edition
Featured Item
We just published our latest original content piece. It will be helpful if you are looking for a CMS for your next project.
Have you ever wondered which CMSs are built with Symfony? Well, probably not, but if you have this reference article shows which ones are and provides their relevant details.
Exploring the Content Management Systems of Symfony.
This Week
Running a Symfony app inside a Docker container has a lot of advantages, but the downside is we have to type a longer command if we want to run the command inside the container. For this purpose, I wrote a small bash script to help me with that.
Run Symfony commands inside a Docker container
https://smoqadam.medium.com/run-symfony-commands-inside-a-docker-container-b9bb9768efa1
Wouter Carabain writes "securing your API endpoints is very important to prevent unauthorized access to your systems. But how do you do this efficiently? Are you going to build a user management system from scratch? Let me introduce you to Keycloak and how to integrate it with API Platform."
Integrating Keycloak with API Platform https://woutercarabain.com/webdevelopment/integrating-keycloak-with-api-platform/
Hanane Kacemi continues a series of posts on Symfony and Doctrine.
Symfony & Doctrine: Part 4
https://dev.to/hananekacemi/symfony-doctrine-part-4-59al
Dejan Angelov says "Symfony Messenger provides multiple ways for registration and configuration of message handlers. Nowadays, the handlers are usually registered by implementing the component’s MessageHandlerInterface interface, which makes the handlers auto-configurable by default, or by implementing some interface of ours which we can register for autoconfiguration manually. However, with the addition of the attribute's functionality in PHP 8.0, it doesn’t really make sense anymore to use interfaces for the purpose of “describing” our classes. In this article, we’ll explore how we can use our own PHP attributes to register and configure the message handlers."
Using custom PHP attributes for registering and configuring Symfony Messenger handlers
https://angelovdejan.me/2022/01/09/custom-php-attributes-for-symfony-messenger-handlers.html
Programming Insider explores PHP Web Frameworks in this article.
Top 5 Fastest-Growing PHP Web Development Frameworks
https://programminginsider.com/top-5-fastest-growing-php-web-development-frameworks/
Last Week
Matt Glaman writes in the early days of Drupal 9 most folks were only using PHPStan on their Drupal sites via drupal-check for deprecation checks. I am excited to see more folks using PHPStan directly with phpstan-drupal to perform static analysis and deprecation checks. However, folks are starting to hit some Drupal WTFs when performing static analysis on a magical code base."
Documenting PHPStan + Drupal! https://mglaman.dev/blog/documenting-phpstan-drupal
Timeless
Sponsored Article
All sponsored articles are for products we have vetted and stand behind. We either use them or would do so if they were applicable to the Symfony Station site.
We published our first sponsored article on Symfony Station exploring how Code Execution Monitoring helps you identify bugs and bottlenecks in your Symfony app before your customers do. Like all our articles it is now available via audio.
Why You Should Use Code Execution Monitoring with Symfony
Gábor Hojtsy says "I apparently released the Drupal configuration schema cheat sheet 7 years ago (wow!) to help people adopt the then new format to describe configuration structure. I keep getting questions and requests about it, so decided to make a major update to it now and bring it to the present day for Drupal 9."
Major Drupal configuration schema cheat sheet update - 7 years later
http://www.hojtsy.hu/blog/2021-dec-22/major-drupal-configuration-schema-cheat-sheet-update-7-years-later
Houssemeddine Souissi explores the new Symfony Authentication System (Login & Logout) in a fresh 5.4 project in this video and article.
New Authentication System
https://devbrains.tn/tutorials/new-authentication-system
He also looks at RabbitMQ.
Discover RabbitMQ with Symfony 5 Project https://devbrains.tn/tutorials/discover-rabbitmq-with-symfony-5-project
Somehow, I missed these two posts from Tomas Votruba. He examines the Symfony HTTP Kernel component and when to use it.
When Symfony Http Kernel is too Big a Hammer to Use https://tomasvotruba.com/blog/when-symfony-http-kernel-is-too-big-hammer-to-use/
Decomposing Symfony Kernel: What does Minimal Symfony Bundle Do https://tomasvotruba.com/blog/decomposing-symfony-kernel-what-does-minimal-symfony-bundle-do/
PHP
This Week
Brent writes "It's the fourth time I'm writing a yearly "PHP in 20XX" post, and I must admit I've never been as excited about it as this year: we've seen awesome new features added to PHP, with stuff like attributes, enums, promoted properties and fibers; and on top of that, the static analysis community is making great progress, my personal favorite feature is PhpStorm now supporting generics when writing code."
Exciting times are ahead, let's take a look at modern-day PHP!"
PHP in 2022
https://stitcher.io/blog/php-in-2022
In this extensive tutorial Eric, the Coder examines the recent additions to PHP.
Modern PHP crash course
https://dev.to/ericchapman/modern-php-crash-course-3606
Backend Developer notes "are lots of new things in PHP and in this article, I will explain what fibers are and why we should use them in our projects."
Php 8.1 New Features — Fibers
https://kvnc-inc.medium.com/php-8-1-new-features-fibers-49744f84c151
Jolicode helps us find out how to approach a clone without fear.
PHP Clone All The Things
https://jolicode.com/blog/php-clone-all-the-things
The ability to return nulls makes it all too easy to write brittle software.
Null Return Types
https://afilina.com/learn/nulls/return-types
Andrea Spraga writes "At Slope, writing tests is a relevant part of our day-to-day work. Having to maintain many integrations and end to end (functional) tests, we are continuously required to create and manage fixtures." In this post, he shows us how.
A library-less approach to fixtures in PHP tests https://dev.to/andreasprega/a-library-less-approach-to-fixtures-in-php-tests-54li
Prosper Yong notes "date and time manipulation is one of a few frequently-experienced challenges of developing web apps in PHP. And one of its most prevalent issues is identifying time disparities and making them readable, such as "one hour ago".
However, handling dates and times — and issues such as this — is greatly simplified by using Carbon; it's a library which reduces lengthy hours of coding and debugging to only a few lines of code."
Times in PHP Using Carbon
https://dev.to/yongdev/how-to-manage-dates-and-times-in-php-using-carbon-1jne
Lorenzo B says "Every sufficiently complex web application use cookies and sessions. They are two technologies that you absolutely have to know, even if you are not a web developer. Why am I saying that? What are their usages and what should you use and why?
In this article, I will help you get an answer to those questions. Plus, I will show you some PHP functions you can use to implement cookies and sessions."
Cookies and Sessions: A Gentle Introduction With PHP https://levelup.gitconnected.com/cookies-and-sessions-a-gentle-introduction-with-php-44acb3a6c483
Anders Björkland continues his series of articles examining the SilverStripe CMS.
Create reviews for Googled books (in SilverStripe) https://dev.to/andersbjorkland/create-reviews-for-googled-books-in-silverstripe-53do
Eelco Verbrugge writes "in PHP a child class can inherit only from one single parent. This allows a class to reuse methods from vertical hierarchy by extending an Abstract class.
If you like to reuse methods in many classes in horizontal hierarchy, we use Traits. Traits are used to group methods and implement them in multiple classes. Traits can't be initiated on its own like a normal class could."
PHP Traits Explained https://dev.to/eelcoverbrugge/php-traits-explained-197e
Last Week
Rafael Bernard Araujo says of PHP Initializers "When I see this new feature, lots of places that use Dependency Injection[3] come to my focus as candidates to be impacted, such as application or infrastructure service classes. As a result, we will write a much cleaner and leaner code without giving up good practices for writing modular, maintainable, and testable software."
PHP 8.1: more on new in initializers https://rafael.bernard-araujo.com/php-8-1-more-on-new-in-initializers.php
Timeless
Other
JavaScript developer Marak Squires wasn't happy about not making money from his open-source libraries, so he deliberately corrupted them, leaving programmers and end-users with dead-in-the-water programs. ZDNet gives us the low-down.
When open-source developers go bad
https://www.zdnet.com/article/when-open-source-developers-go-bad/
I didn't know this, but Alexandre Daubois tells us that the "Internet truly relies on 13 servers. How is it possible?"
The 13 Master Servers of Internet
https://medium.com/geekculture/the-13-master-servers-of-internet-97c4bb800943
Kadeisha Kean says "to inspect or update a web page dynamically, you need to access its elements. Find out how to use DOM selectors to target various parts of your page.
Learn How to Use DOM Selectors
https://www.makeuseof.com/dom-selectors-how-to-use/
Docker has a new capability.
Introducing SSO for Docker Business https://www.docker.com/blog/introducing-sso-for-docker-business/
Have you published or seen something related to Symfony or PHP that we missed? If so, please contact us.
That's it for this week. Thanks for making it to the end of another extended edition. I look forward to sharing next week's Symfony and PHP news with you on Friday.
Please share this post. :) Be sure to join our newsletter list at the bottom of our site’s pages. Joining gets you each week's communiqué in your inbox (a day early). And follow us on Twitter at @symfonfystation.
Happy Coding Symfonistas!
Reuben Walker
Founder Symfony Station
Reuben is also Ringmaster of Mobile Atom Media and its division Mobile Atom Code.
Top comments (1)
Oh, am I guilty of returning null types! It's good to be reminded of different ways to write our code. I haven't had a problem with returning null, but it's a problem just waiting to happen and at that point I risk having a lot of code to refactor 😅