PHP / Magento Dev Blog

  • Home

Custom payment method – authorize/capture/refund, JS renderer, PCI DSS

  • 0
Henryk Tews
Tuesday, 09 August 2022 / Published in Magento / Adobe Commerce

Building a custom payment method in Magento 2 is one of the more complex integrations you can do on the platform. It touches frontend JavaScript, backend PHP, REST API configuration, and security requirements. I walk through the complete implementation – authorize, capture, refund, the JS renderer for checkout, and PCI DSS considerations.

(more…)

PHP 8.2 preview – readonly classes, DNF types, dynamic properties deprecated

  • 0
Henryk Tews
Tuesday, 12 July 2022 / Published in PHP

PHP 8.2 arrives in November 2022 and its headline features are more conservative than 8.0 or 8.1, but each one plugs a real gap in the type system. Readonly classes eliminate boilerplate in immutable DTOs. DNF types allow complex type expressions that were impossible before. Deprecating dynamic properties starts enforcing something good OOP practice demanded for years.

(more…)

GoF patterns in Magento 2 – where to find them and how they work

  • 0
Henryk Tews
Tuesday, 21 June 2022 / Published in Magento / Adobe Commerce, Wzorce projektowe

After covering all 23 GoF patterns individually, time to see where they actually live inside Magento 2. The platform is a textbook example of design patterns applied at scale – DI, plugins, observers, repositories, factories all map directly to specific GoF patterns. This post is a guided tour of patterns hiding in plain sight in Magento’s architecture.

(more…)

Command and Chain of Responsibility in PHP – behavioural patterns

  • 0
Henryk Tews
Tuesday, 14 June 2022 / Published in Wzorce projektowe

Command and Chain of Responsibility are two behavioural patterns that both deal with processing requests – but from different angles. Command encapsulates a request as an object, enabling undo, queuing, and logging. Chain of Responsibility passes the request along a handler chain until one processes it. I show GoF implementations and their natural fit in Magento 2.

(more…)

Observer and Strategy in PHP – behavioural patterns

  • 0
Henryk Tews
Tuesday, 07 June 2022 / Published in Wzorce projektowe

Observer and Strategy are two of the most widely used behavioural patterns. Observer defines a publish-subscribe mechanism where subjects notify observers of state changes. Strategy defines a family of interchangeable algorithms. Both appear throughout Magento 2 – I show GoF implementations and the platform’s concrete use of each.

(more…)

Adapter and Facade in PHP – structural patterns

  • 0
Henryk Tews
Tuesday, 31 May 2022 / Published in Wzorce projektowe

Adapter and Facade are two structural patterns that manage complexity at the boundaries of a system. Adapter makes incompatible interfaces work together. Facade simplifies a complex subsystem behind a clean, high-level interface. Both appear constantly in real PHP projects – I show implementations and concrete examples from Magento 2.

(more…)

Decorator and Proxy in PHP – structural patterns

  • 0
Henryk Tews
Monday, 23 May 2022 / Published in Wzorce projektowe

Decorator and Proxy look similar at first glance – both wrap another object and implement the same interface. The intent is different. Decorator adds new behaviour. Proxy controls access. This post covers both structural patterns in depth, with PHP implementations, concrete use cases, and a comparison that clarifies when to reach for each one.

(more…)

Singleton and Builder in PHP – creational patterns

  • 0
Henryk Tews
Tuesday, 17 May 2022 / Published in Wzorce projektowe

Singleton and Builder are two more creational patterns from the GoF catalogue. Singleton is probably the most controversial – often misused, but legitimate in specific contexts. Builder shines when constructing complex objects with many optional parameters. I show both with PHP implementations, pitfalls, and practical examples.

(more…)

Factory Method and Abstract Factory – implementations, differences table, Simple Factory

  • 0
Henryk Tews
Tuesday, 10 May 2022 / Published in Wzorce projektowe

Factory Method and Abstract Factory are both creational patterns that remove the new keyword from business logic – but they solve different problems. Factory Method delegates creation to subclasses. Abstract Factory creates families of related objects. I implement both from scratch, compare them in a table, and show where Simple Factory fits as a pragmatic alternative.

(more…)

Design patterns – introduction, 23 GoF patterns table, when to use and when not to

  • 0
Henryk Tews
Tuesday, 03 May 2022 / Published in Wzorce projektowe

Design patterns are reusable solutions to recurring design problems. The Gang of Four book from 1994 catalogued 23 patterns split into three categories. They are not code snippets to paste in – they are a vocabulary for communicating design decisions. This post is an introduction and reference table before I cover each pattern individually in the coming weeks.

(more…)

  • 13
  • 14
  • 15
  • 16
  • 17

© 2026 Created by

TOP
Zarządzaj zgodą
Aby zapewnić jak najlepsze wrażenia, korzystamy z technologii, takich jak pliki cookie, do przechowywania i/lub uzyskiwania dostępu do informacji o urządzeniu. Zgoda na te technologie pozwoli nam przetwarzać dane, takie jak zachowanie podczas przeglądania lub unikalne identyfikatory na tej stronie. Brak wyrażenia zgody lub wycofanie zgody może niekorzystnie wpłynąć na niektóre cechy i funkcje.
Funkcjonalne Always active
Przechowywanie lub dostęp do danych technicznych jest ściśle konieczny do uzasadnionego celu umożliwienia korzystania z konkretnej usługi wyraźnie żądanej przez subskrybenta lub użytkownika, lub wyłącznie w celu przeprowadzenia transmisji komunikatu przez sieć łączności elektronicznej.
Preferencje
Przechowywanie lub dostęp techniczny jest niezbędny do uzasadnionego celu przechowywania preferencji, o które nie prosi subskrybent lub użytkownik.
Statystyka
Przechowywanie techniczne lub dostęp, który jest używany wyłącznie do celów statystycznych. Przechowywanie techniczne lub dostęp, który jest używany wyłącznie do anonimowych celów statystycznych. Bez wezwania do sądu, dobrowolnego podporządkowania się dostawcy usług internetowych lub dodatkowych zapisów od strony trzeciej, informacje przechowywane lub pobierane wyłącznie w tym celu zwykle nie mogą być wykorzystywane do identyfikacji użytkownika.
Marketing
Przechowywanie lub dostęp techniczny jest wymagany do tworzenia profili użytkowników w celu wysyłania reklam lub śledzenia użytkownika na stronie internetowej lub na kilku stronach internetowych w podobnych celach marketingowych.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
Zobacz preferencje
  • {title}
  • {title}
  • {title}