For some data integrity checks, I needed to know if all SKUs stored in a MySQL database table have been properly imported. That implied making sure each SKU contained a string with 2 underscores as a separator. Knowing that PHP has functions like substr_count() or count_chars(), I was surprised that nothing similar exists in MySQL.
Recently, we took over a Magento 2 project where data was migrated from an older Magento 1 instance. The merchant complained that after the migration some customers are not able to log in anymore. Even a password reset did not work.
Whilst I migrated from Linux to Windows and WSL 2 more than a year ago, I had a plan to install any development-related tools like Git or PHPStorm in WSL2. PHPStorm worked quite ok in WSL 2 except that filesystem changes (e.g. adding or removing files) made directly in WSL 2 were not properly recognized by PHPStorm. Even triggering a manual refresh from the disk did not always work. That made me install PHPStorm on Windows and open PHP projects via the WSL 2 integration of PHPStorm. That works better but still has its issues with larger projects.
Besides supporting PHPStan version 1.3, the latest phpstan-magento extension release 0.15.0 adds support for extension attributes for both Magento modules and Magento applications.
Extension Attributes allow developers to “extend” existing API Data interfaces by defining additional attributes in an XML-based configuration. The phpstan-magento extension parses these XML definitions and generates the respective interfaces so that PHPStan can analyze these interfaces.
Two weeks ago the bitExpert PHP team participated in the first API Platform Conference as part of our Learn&Grow initiative. Having built a number of projects based on the API Platform components already, we were keen to get the latest insights and learn from the core team about upcoming features.
As I have written before, we are big fans of Mark Shust's Docker Configuration for Magento project. It comes with quite some useful tools installed out of the box. However, I was missing one: Being able to run PHPUnit from the host environment.
Postman is a tool for API development and testing. In one of our recent projects, we decided to use Newman as our testing cli. In this blog post you can read more about our setup, what this setup is able to do, and - most important - what it's not able to do!
As I have written before, we are big fans of Mark Shust's Docker Configuration for Magento project. Even though we customized the setup a bit for our needs, it comes with a lot of good stuff out of the box, like Xdebug support.
About code quality, automation and git hooks
Imagine you are in the middle of writing some awesome code for a new project of yours. You know, that code on its own isn't all, because it has to be maintainable. And what is better to ensure correct and maintainable code than to have tests and a coding style and some static analysis and whatnot. So in addition to your awesome code you have decided to use a certain coding style. And you are writing tests for your features. And in addition to your tests you also run static analysis to find possible pitfalls even faster.
Besides being big fans of Mark Shust's Docker Configuration for Magento project as I already blogged about, we also love Traefik, the Cloud Native Edge Router. I discovered Traefik years ago and try to use it wherever we can. Depending on the project's goals we either use the open-source version or the enterprise edition. Disclaimer: I am Traefik Ambassador, so I might be a bit biased :)