Skip to main content

15 docs tagged with "class-design"

View all tags

Cohesion, coupling, and SOLID in review

Where Part 1 comes together. Fills in the open-closed, Liskov substitution, and interface segregation principles, then revisits everything so far through cohesion and coupling.

Introduction — why learn class design

Chapter 1 of the PHP Class Design Guide. Through real examples of god classes and code that resists change, it shows what class design is for and lays out the shape of the whole series.

PHP Class Design Guide

A 14-chapter guide that takes class design in PHP from first principles to practice. It runs from framework-independent design principles (encapsulation, single responsibility, inheritance versus composition, interfaces, SOLID) through to model and service class design in Laravel.

PHP class syntax basics

The basic syntax of classes in PHP. Covers properties, methods, constructors, visibility modifiers, readonly, constructor promotion, and enum.

Practice — refactoring class design

Refactors the Fat Controller and Fat Model from chapter 8 end to end, using the criteria from chapters 9 to 12. The practical chapter that puts every Part 1 principle to work.

The single responsibility principle

The single responsibility principle and the idea of keeping classes small. Covers the signs of a god class and a worked example of splitting responsibilities.