State Of Laravel 2023, Inheritance vs Composition, and PHP Code Structuring [W39]
New small Laravel, Symfony, and Php Storm releases this week plus a lot of interesting articles about PHP and it's frameworks.
📊 Need a better Google Analytics Alternative?
A privacy-friendly, no cookies and GDPR compliant alternative that is also configurable. Create funnels, measure your traffic and every event on your site with no hassle.
[Ad] https://metricswave.com - Appear here
Laravel
🆕 Laravel 10.24
A minor release yesterday brings us to Laravel 10.24. Here are the highlights (with correct links this time):
Add notModified to HTTP client in #48379
Turn off autocomplete for csrf_field in #48371
Fix Cache::many() with small numeric keys in #48423
Allow older jobs to be faked in #48434
Introduce Str::substrPos in #48421
Guess table name in migrations with complex column names in #48437
Get value when default is an enum in #48452
You may review the full branch diff on GitHub for a complete list of changes.
📊 State Of Laravel 2023
Like every year, we have to analyze the results of the current state of Laravel. What stack does the community use? SW? Are you happy with Laravel?
Symfony
🆕 5.4 changelog:
0f6c37a: [HttpClient] fix TraceableResponse if response has no destruct method
ac2e41f: [FrameworkBundle] fix support for translator.default_path in XML
1de61c7: [SecurityBundle, PasswordHasher] fix password migration with custom hasher service with security bundle config
c0fbe7f: [Cache] fix support for Redis Sentinel using php-redis 6.0.0
b9c30fb: [DependencyInjection] fix autocasting null env values to empty string with container.env_var_processors_locator
aa56d07: [Messenger] fix cloned TraceableStack not unstacking the stack independently
🆕 6.3 changelog:
a99b697: [Notifier] fix Smsmode HttpClient mandatory headers
0552d19: [FrameworkBundle] handle tags array attributes in descriptors
93afb42: [Routing] fix routing collection defaults when adding a new route to a collection
🆕 6.4 changelog:
c49e2d7: [Translation] give current locale to LocaleSwitcher::runWithLocale() callback
18685c4: [Mime] allow to add some headers as a strings
f9327be: [Translation] add --as-tree option to translation:pull command
dbf4bda: [Messenger] add support for multiple Redis Sentinel hosts
7d310a3: [Translation] refactor ReadConfig and WriteConfig into arrays in Phrase provider
📚 Automatically register doctrine types in Symfony with compiler pass
I'm using more and more value objects in my projects. To integrate them with doctrine, I also create custom doctrine types. Usually you have to register them manually one by one. But you can also register them through a compiler pass to make your live easier.
Articles & Misc
📚 PHP Code Structuring: Building Castles, Not Card Houses
When it comes to writing PHP code, it’s easy to get caught up in the thrill of solving problems and building amazing web applications. However, what separates a professional developer from an amateur is not just the ability to write code but the art of structuring it effectively.
📚 Inheritance vs. Composition in PHP
Inheritance and composition are two fundamental concepts in object-oriented programming.
👨💻 PhpStorm 2023.2.2
PhpStorm 2023.2.2 is released and includes a host of bug fixes and quality-of-life improvements.