PHP: Guides and Practical Know-how | Page 22 | mironsoft Blog
PHP
-
Jul 9, 2025
The visitor pattern separates operations from the class hierarchy they operate on, so new operations can be added without changing existing data classes. Using an abstract syntax tree as an example, this article shows double dispatch, the visitable interface, and the limits of this approach in PHP 8.4.
-
Jul 4, 2025
Immutable objects fundamentally change how reliably PHP code behaves: once constructed, a value object can no longer be secretly changed from anywhere else in the program, because there simply are no setters left. Instead of mutating existing instances, with-methods create a new, fully initialized copy with the changed value on every change. This article uses a running Money example to show how readonly properties, with-methods, and named constructors work together, and why cloning followed by mutation simply does not work technically for readonly properties in PHP.
-
Jul 4, 2025
Anyone who keeps GraphQL queries manually in sync with types builds up technical debt, every single time a schema field changes. Code generation from the schema and operations files turns types into automation instead of a maintenance chore.
-
Jul 1, 2025
The most common experience in PHP projects: tests are hard to write because the production code makes them hard. Dependencies instantiated directly, global state, too many responsibilities crammed into one class. Testability is not a random byproduct, it is the result of concrete design decisions made in the production code.
-
Jun 30, 2025
Outdated dependencies are, according to OWASP, one of the most common entry points into web applications. This article shows how Magento teams monitor CVE databases, protect composer.lock against uncontrolled drift, automate updates with Dependabot or Renovate, and reliably keep up with Magento's quarterly security patch cycle without destabilizing the codebase.
-
Jun 29, 2025
Every API integration, every webhook and every payment gateway call depends on choosing the right PHP HTTP client. This article compares raw cURL, Guzzle and Symfony HttpClient across middleware, async support, PSR-18 compatibility and testability, with real code examples for each solution.
-
Jun 29, 2025
PhpStorm can do more than just display code: start Docker Compose services, activate Xdebug in the container, run Magento CLI commands, and use the remote interpreter for autocompletion, once you know what really belongs together and what is better left in the terminal.
-
Jun 28, 2025
Anyone who needs to generate invoices as PDF from a PHP application without a Node.js dependency almost always ends up with Dompdf or wkhtmltopdf. Both libraries only support a subset of the CSS features that a Tailwind template uses in the browser, which is why invoice layouts must be deliberately built on tables instead of flexbox.
-
-
Jun 25, 2025
PhpStorm on a Magento 2 project with hundreds of thousands of vendor files can feel like a sluggish tool. The reason is almost always the same: too many files in the index, too little heap memory, too many active plugins. With systematic diagnosis the problem can be fixed within an hour.