PHP: Guides and Practical Know-how | Page 9 | mironsoft Blog
PHP
-
Jan 3, 2026
The PHPStorm plugin marketplace lists dozens of plugins that promise to simplify Magento development. In practice, many of them add little value, noticeably slow down the IDE, or are simply irrelevant for Hyva projects. This article separates the real productivity boosters from the resource hogs.
-
Jan 2, 2026
Some tests can only be written cleanly if PHPUnit runs them in a completely new PHP process: for example when legacy code defines constants that cannot be redefined, or when static state is so deeply entangled that a reset in tearDown is not enough. @runInSeparateProcess solves this reliably, but not for free: every isolated test starts its own PHP interpreter, which can noticeably drive up a suite's runtime if it is used too liberally.
-
Dec 31, 2025
PHPUnit runs four different lifecycle hooks in a fixed order, two of them once per class, two of them before and after every individual test. Anyone unclear on this precise order easily ends up building tests that appear isolated but actually share state through static properties. This article walks through the full chain, the typical mistakes, and when static instead of instance methods are actually needed.
-
Dec 29, 2025
At first glance static properties look like a convenient place for class wide state, such as a counter or a registry. Once inheritance enters the picture, though, a pitfall appears that regularly surprises experienced developers: a static property declared in the base class is not duplicated per subclass, it is shared by all subclasses unless explicitly redeclared. This article walks through the problem with concrete examples and describes ways to avoid it reliably.
-
Dec 27, 2025
Anyone who hunts performance problems in PHP applications only through gut feeling and spot-checks in production wastes time on the wrong places. Blackfire and XHProf deliver reliable callgraphs, separate exclusive and inclusive times, as well as standalone wall time, CPU time, and I/O wait metrics, letting you clearly distinguish real bottlenecks from harmless symptoms, whether in a monolith, a microservice, or a CLI script.
-
Dec 27, 2025
With over 30,000 PHP files, Magento 2 is one of the largest open-source PHP projects. Without a correct PhpStorm configuration, indexing takes minutes, autocomplete stays silent, and the IDE turns into a bottleneck instead of a helper. This guide shows how to set up PhpStorm so it works productively with Magento.
-
Dec 27, 2025
The Reflection API turns PHP classes, methods, properties and parameters into inspectable objects at runtime. Anyone who wants to understand how dependency injection containers, ORMs and test frameworks work internally cannot avoid ReflectionClass, ReflectionMethod and ReflectionProperty, and using them correctly lets you build frameworks that adapt to arbitrary classes unknown at development time.
-
Dec 21, 2025
A devcontainer moves the entire development environment into a container, so every developer uses the exact same PHP version, the same extensions and the same tools, regardless of their own machine. Instead of hours of onboarding documentation, a single click on "Reopen in Container" is enough.
-
Dec 17, 2025
Lighthouse wires GraphQL schemas directly onto Eloquent models, without requiring a dedicated resolver for every field. Instead of building PHP classes, SDL directives like @hasMany, @paginate and @guard describe the entire connection to the database, relationships and middleware. Anyone already familiar with Laravel conventions gets productive with Lighthouse quickly.
-
Dec 15, 2025
A chain of multiple assertEquals calls comparing individual fields of a domain object is tedious to write and only delivers fragmentary information on failure. Custom, domain specific assertions such as assertMoneyEquals or assertValidOrderState bundle these comparisons in one place and produce failure messages that immediately show what went wrong from a business perspective. This article explains how such assertions come together and when the effort pays off.