PHP: Guides and Practical Know-how | Page 6 | mironsoft Blog
PHP
-
Feb 8, 2026
Ordinary find/replace and regex search are blind to PHP semantics. Structural Search and Replace understands the Abstract Syntax Tree, and replaces exactly what the code structurally means, not what it literally contains. The result: safe, semantically correct bulk changes without false positives.
-
Feb 8, 2026
With Schema-First, the SDL file comes first and becomes the contract between frontend and backend. With Code-First, a library generates the schema from classes and decorators. Both paths produce a working GraphQL API, yet they differ fundamentally in tooling, team structure, and long-term maintainability.
-
Feb 5, 2026
Database migrations are versioned, traceable schema changes that every team runs without manual ALTER TABLE commands over SSH connections. A custom built migration system made of a migrations table, up and down methods and a lean CLI runner covers the core requirements without introducing Doctrine Migrations or Laravel as a dependency.
-
Feb 2, 2026
Magento 2 poses particular challenges for PhpStorm: thousands of generated classes, a huge vendor/ tree, PHPUnit tests across multiple layers, and phtml templates with mixed PHP/HTML syntax. The right configuration makes the difference between a sluggish IDE and a precise development environment.
-
Feb 1, 2026
Classic PHP in the shared-nothing model has no true in-memory connection pool within a single process. Anyone who still wants to avoid the overhead of constant reconnects needs either persistent connections with clear boundaries, an external connection pooler like ProxySQL, or a long-running process model like Swoole.
-
Feb 1, 2026
Nearly every modern PHP framework promises a PSR-15 compatible middleware pipeline, yet what happens internally stays a black box for many developers. We build the pipeline step by step ourselves, without a framework, and use logging, auth and CORS middleware to show exactly how the onion model works technically.
-
Feb 1, 2026
PSR standards are the reason why any logger, any cache adapter and any HTTP client are interchangeable in practically every modern PHP project, without application code needing to change. Anyone who knows the most important PSR standards, from logging through caching to event dispatching, chooses libraries more deliberately and avoids unnecessary coupling to a single vendor.
-
Jan 31, 2026
willReturn() covers the vast majority of all mocking needs, return a fixed value, done. Sometimes that is not enough though: a mock needs to react differently depending on the argument it receives, or its behavior needs to change dynamically across several calls. That is exactly what willReturnMap and willReturnCallback are for. This article explains how both work and where the line sits, past which a mock already contains too much logic of its own.
-
Jan 31, 2026
Unreviewed Composer dependencies are among the most common entry points in Magento and PHP projects. This article shows how composer audit, Roave Security Advisories and automated CI pipelines reliably surface known vulnerabilities before they reach production, and how teams separate real risk from pure scan noise without manually reviewing every single warning.
-
Jan 31, 2026
Not every random number in PHP is equally secure. While rand() and mt_rand() are fine for games and simulations, they are dangerously predictable for tokens, password reset links or cryptographic keys. random_bytes, random_int and the Randomizer class from PHP 8.2 deliver genuinely cryptographically secure random values for exactly these cases.