REST API design is one of those topics where everyone has an opinion but few have a consistent set of rules. Resources vs actions, the right HTTP status codes, response structure, versioning – decisions made here stay with the API for years. I show the principles I follow when designing REST APIs in PHP projects and Magento 2 modules.
Unit testing in PHP projects is a topic most developers know in theory but keep putting off until “when there is time”. The time never comes. I show how to get started with PHPUnit, how to write tests that actually check something meaningful, and how to mock dependencies – with examples that look like real production code.
Symfony is not just a framework – it is a set of independent PHP components you can use separately in any project. Magento 2 itself uses them (Console, Filesystem, Serializer). I show a few components that genuinely help in everyday PHP and Magento work: Console for writing CLI commands, Validator for validating data, and HttpClient for communicating with external APIs.
PHP 8.0 was officially released on 26 November 2020. I wrote about the previews in July – now that I have the final version, it is time for first practical impressions. I check what works as promised, what surprised me, and what to watch out for when migrating older projects.
Magento’s built-in Full Page Cache stores pages in files or Redis. It works, but it handles requests inside PHP – nginx and PHP-FPM still have to start for every request. Varnish sits in front of nginx and serves pages from memory without touching PHP. For a shop with traffic that is the difference between a second and milliseconds.
As a PHP developer you have probably had some contact with jQuery and maybe a bit of plain JS. Vue.js is the next step – a reactive framework that increasingly appears in e-commerce projects as a frontend layer for headless Magento or as a replacement for the older knockout.js. I show the basics from the perspective of someone who thinks in PHP day to day.
Since Magento 2.4 Elasticsearch is the only supported search engine – MySQL Search was removed. For many shops it “just works”, but when a client reports that “the search doesn’t find the right products”, the real work begins. I show how Magento indexes data in ES, how to debug queries, and how to extend the index with custom fields.
PHP 8.0 ma wyjść w listopadzie 2020 i będzie największą zmianą w języku od czasu PHP 7.0. JIT compiler, union types, named arguments, match expression, constructor property promotion – to nie są drobne poprawki. Przeglądam najważniejsze nowości na przykładach i oceniam co realne znaczenie dla codziennego kodu z Magento 2.
Repository is a pattern that separates business logic from the details of data access. Instead of scattering SQL queries or ORM calls throughout the application, you have one class responsible for fetching and saving entities. In Magento 2 Repository is part of Service Contracts – a standard, not an option. I show how to build your own Repository from scratch and why it is worth doing.
When a shop has several thousand products with dozens of attributes in several languages, managing product data directly in Magento becomes a real pain. Akeneo PIM solves this – it centralises product data and delivers it to Magento (and other channels) through an API. I show why you would want a PIM and what the technical integration looks like.
