Proxy pattern – lazy loading, cache, access control and \Proxy in Magento 2 DI
The Proxy pattern controls access to another object. The client thinks it is talking to the real object, but in reality it is talking to an intermediary that can add caching, logging, lazy loading, access control or remote access. In Magento 2 Proxy is a built-in mechanism – every class with the \Proxy suffix in the DI container is exactly this pattern.
- Published in Wzorce projektowe
Hash Table – PHP implementation, O(1) lookup, deduplication and grouping
A hash table is a data structure with O(1) for insert, lookup and delete on average. PHP uses it internally for arrays – every PHP array is effectively a hash map. But knowing how it works under the hood lets you write more efficient code and understand why certain operations are fast and others surprisingly slow.
- Published in Algorytmy
Magento 2 checkout freezes on shipping step – external carrier API timeout
Checkout was freezing on the shipping selection step – the spinner kept spinning indefinitely. Customers could not proceed. The problem affected 100% of users on all browsers. Diagnosis time: 2 hours, fix time: 20 minutes.
- Published in Magento / Adobe Commerce
PHP named arguments and first-class callables – practical pipeline applications
PHP 8.1 and 8.2 brought named arguments and first-class callables – two features that change the way code is written. Named arguments eliminate “argument order confusion” and improve the readability of function calls with many parameters. First-class callables replace Closure::fromCallable() and [$this, 'method'] with the clean func(...) syntax.
- Published in PHP
