mglaman.dev – May, 26 2023
Hey there!
Here's your weekly newsletter from me, Matt Glaman!
I sat down with Mark and Dave of Chromatic for an episode of their D7 End of Life podcast. I'll share the link on my socials and this newsletter when it comes out.
Was this forwarded to you? You can subscribe here!
My latest blog post
This week I wrote about anti-patterns commonly used by Drupal developers in constructors for services using dependency injection.
Dependency injection anti-patterns in Drupal
Whenever I have done an audit for a Drupal codebase, one of the first things I manually review and profile is dependency injection anti-patterns in custom code and any contributed modules used. The anti-pattern isn't for accessing services statically through \Drupal: service. These anti-patterns live within the class's __construct method.
Tips & tricks
It is crucial to prioritize tests for both present and future stages to ensure the top quality and reliability of the codebase. These tests are critical in providing essential documentation and simplifying the code review process, resulting in more efficient and effective outcomes. Prioritizing testing efforts helps developers ensure their code is thoroughly tested and meets all requirements.
This week's live stream
I hacked on phpstan-drupal and fixed a bug with property reflections on entity classes when using stubs or phpDoc property tags.
Twitch
Twitch is the world's leading video platform and community for gamers.
Interesting links
- A release plan for contributed Drupal extensions
- Great blog outlining why contrib projects need release planning and cadence (but we need more tooling. Getting ever closer with GitLab for UI-based tagging.)
- When to declare classes final
- I jumped on the
final
andprivate
bandwagon some time back, and it has recirculated as a topic.
- I jumped on the
- andysnell/int-to-uuid: Integer ID To RFC 4122 UUID Converter
- I found the package and it looks super interesting for bridging serial identifiers and UUIDs in applications.
If you enjoyed this, consider forwarding it to a friend.
Have suggestions or ideas for future blog posts and newsletters? Let me know!