PHP Annotated – June 2022

Greetings everyone!

Welcome to the June installment of PHP Annotated, where we’ll catch up on the most interesting things that have happened in the PHP world over the last month, including curated news, articles, tools, and videos.

Kudos to Sergey Panteleev for helping compile the June edition of PHP Annotated.

News

php.net received a new homepage design!
Thanks to Lucas Azevedo and the team for the refreshing look.
PHP 7.4.30, PHP 8.0.20, and PHP 8.1.7 have been released
This is a security update to the supported branches. All users are encouraged to upgrade to the latest version.
PHP 8.2.0 Alpha 1 has been released
The first alpha has been released, kicking off the PHP 8.2 release process. Updates will be released every two weeks on a defined schedule with the final release expected around November 24.

A feature freeze is expected on July 19, meaning some changes might still make it into the release. The most notable changes at the moment are as follows:

readonly Classes
true type
Allow null and false as standalone types
Sensitive Parameter value redaction support
Dynamic Properties are deprecated
Partially-supported callable are deprecated
${var} string interpolation deprecated

For a complete list of changes, see php.watch/versions/8.2.

If you are on Mac, you can try PHP 8.2 with homebrew via the Nightly channel thanks to shivammathur/homebrew-php.

Otherwise, Docker images are probably the best option to try it with no hassle.

PER Coding Style has been tagged 1.0.0
PER Coding Style 1.0.0 is the same as PSR-12. This recommendation will now evolve much faster to keep up with all the new features that we’re getting in the PHP language.
Congratulations to the whole working group!

If you don’t know what a PER is, it’s similar to a PSR but it’s not set in stone, it’s meant to evolve rapidly over time, so the coding style is the perfect example where a PER is the best way to go.

More information about the PER workflow here: https://t.co/jlrrX38AJQ

— PHP-FIG (@phpfig) June 10, 2022

PhpStorm 2022.2 Early Access Program Is Open
Built-in Rector support, lots of improvements for generics in PHP, and more.
Developer Ecosystem Survey 2022
Take part in the yearly ecosystem survey for the chance to win a MacBook Pro, Xbox Series X, PlayStation 5, or other prizes.

PHP Core

Most of the Core news is covered in detail in the PHP Core Roundup series from the PHP Foundation. The third episode of this series is coming soon, so we’ll only mention it briefly:

RFC: Add true type #PHP 8.2
In addition to null and false pseudotypes, PHP will now have a standalone true type, which is the natural counterpart of false.

For more details, listen to Derik Rethans’ PHP Internals News podcast with George P. Banyard, the author of this change.

RFC: Undefined Property Error Promotion #PHP 9.0
RFC: Expand deprecation notice scope for partially supported callables #PHP 8.2
📊 RFC: Stricter implicit boolean coercion #PHP 8.2
📊 RFC: Create a global login system for php.net
The RFC proposes to create an SSO for *.php.net sites. The implementation plan, however, is unclear, so it likely will not make it past the first attempt.
📊 RFC: Random Extension 5.x #PHP 8.2
Kudos to Go Kudo for this RFC and for their persistence after the previous attempt.
🤔 RFC: Fetch properties in const expressions #PHP 8.2
enum A: string {
case B = ‚B‘;
// This is currently not permitted
const C = [self::B->value => self::B];
}

There are some userland examples of where this could be quite useful. Take Symfony and #[Target], for instance.
🤔 [RFC] Short Closures 2.0
Originally proposed by Nuno Maduro and Larry Garfield, and now picked up by Arnaud Le Blanc, this RFC proposed extending arrow functions by allowing multiple statements:
fn () {
$tmp = $a + $b;
return $tmp;
}

Interview with the PHP Foundation Core Developers supplemented with answers from Arnaud Le Blanc.

Tools

Indigo (beta) — This tool aims to revolutionize the way you configure and run local dev environments on Mac.
The Paragon Initiative Enterprises team released Easy-ECC 1.0.0, a tool making it easier to work with elliptic curve cryptography on PHP, and PASETO, a more secure alternative to JWT.
minicli/minicli – A minimalist, dependency-free framework for building CLI-centric PHP applications.
crwlr/query-string – A Swiss Army knife for URLs. It allows you to create, access, and manipulate query strings for HTTP requests very conveniently. See the article for more details.
voku/simple_html_dom – A modern, simple HTML DOM Parser for PHP.
PHP-CS-Fixer Configurator – A nice website with all of the PHP CS Fixer options and their descriptions.
IvanGrigorov/VMValidator – A set of attributes to validate PHP models.
thecodingmachine/graphqlite – This tool allows you to use PHP Attributes/Annotations to declare GraphQL API.
exakat/php-static-analysis-tools – A reviewed list of useful PHP static analysis tools. It’s not only Psalm/PHPStan. There is also Qodana PHP, a tool by JetBrains that brings all the PhpStorm smart checks to CI pipelines.
nmcteam/3dash – Tiny static site generator for PHP. Sculpin and Jigsaw are cool, but this small tool is really neat and has a very simple API. Check out the official website for a quick example: 3dash.dev.

PhpStorm

DDEV Integration – IntelliJ IDEs Plugin – A beta version of the DDEV Integration Plugin for PhpStorm.
Boost your productivity in Laravel with advanced PhpStorm setup by Dmitry Khorev.
Clean and minimalistic PhpStorm by Brent Roose.

Symfony

Symfony 6.1 has been released and includes lots of great new features.

Symfony 6.1 was released 3 hours ago. We just merged the upgrade PR and shipped it to production 🚀 Everything runs smoothly.

The application is ±10 years old, has 10k+ classes and is now handling 20k rpm.

Happy Friday everyone 😎https://t.co/Ce263ESQ6a https://t.co/RKJtEFrFfZ pic.twitter.com/5SJrmPPtxK

— Ruud Kamphuis (@Ruud_) May 27, 2022

Get certified on Symfony 6 and Twig 3
Symfony 6 and Twig 3 online certifications are now available. Both exams have been reworked from the ground up.
A Week of Symfony #806 (6-12 June 2022).
Initializing your Symfony project with solid foundations by Loïc Vernet.
How to test Symfony routes to make huge refactoring safe by Tomas Votruba.

Laravel

spatie/laravel-comments-livewire – A new, paid Livewire package from Spatie to associate comments with models in your Laravel application.
laravel/vite-plugiVite is a modern frontend build tool that provides a fast development environment and bundles your code for production. Laravel now integrates seamlessly with Vite by providing an official plugin and Blade directive to load your assets for development and production.
hasinhayder/hydra – A zero-config API boilerplate with Laravel 9x + Laravel Sanctum that comes with an excellent user and role management API out of the box.
Laravel Artisan Cheatsheet – An online reference for Laravel’s built-in artisan commands and their options.
codestudiohq/laravel-totem – The tool allows you to manage your Laravel Schedule from a well-organized dashboard.
worksome/request-factories – Test requests in Laravel without all the boilerplate.
35 Laravel Eloquent Recipes by Martin Joo.
Laravel Route Grouping: 6 Techniques to Organize Routes by Povilas Korop.
How To Implement Laravel Dynamic Scheduling by Ian Kumu.
Restructuring a Laravel Controller using Services, Events, Jobs, Actions, and more by Povilas Korop.

Misc

My PHP enum style guide by Brent Roose.
List-o-mania by Mark Baker. An article on PHP’s list construct with some clever tricks and a few of its limitations.
The very useful variadic argument by Damien Seguy.
Reviewing Property Declaration In PHP by Damien Seguy.

Community

2022 PHP Conferences List.
Check out these funny t-shirts by Rafael Dohms:

Where can you get an elephpant?

Light blue and pink ones: elephpant.com.
Blue PHP 8 inphpinity: exakat.io.
White, Joker, and Dark blue: confoo.ca.
Orange: thelia.net.
Italy tricolor: grusp.org.
Orange php[architect]: phparch.com/swag.
Red Laravel: phparch.com/swag.

Did you know that WordPress has an adorable mascot too?

#Wapuu will be everywhere at WordCamp Europe! How many different pictures can you get of him? Post them at https://t.co/iVD2K7rvx2 so we can see them all!

📸 “Wapuu ready to travel to #WCEU” by Nicholas Garofalo on the #WordPress Photo Directory https://t.co/90SvbhINp6 pic.twitter.com/0YfURIAV5X

— WordPress (@WordPress) June 2, 2022

That’s all for today – thanks for reading!

If you have any interesting or useful links to share via PHP Annotated, please leave a comment on this post or send me a tweet.

Subscribe to PHP Annotated

Your JetBrains PhpStorm team
The Drive to Develop

The PhpStorm Blog : The Lightning-Smart IDE for PHP Programming | The JetBrains Blog
Read More