How to use constructor promotion in PHP 8
This is so good! The only thing that feels wrong is the empty brackets. What is a constructor property promotion? It is a new syntax that PHP 8 brings, allowing two simultaneous operations: Class property declaration and Constructor assignment, right from the constructor. See how it works: See the official documentation.