© Kelt Dockins 2017

Kelt Dockins, Design Patterns in PHP and Laravel, 10.1007/978-1-4842-2451-9_2

2. Let’s Grow a SOLID Garden

Kelt Dockins

(1)Dolph, Arkansas, USA

$> git checkout solid_design

In 2009, a game called Farmville exploded on Facebook. My mother was addicted; I might have been too but I’m too proud to admit it. We aren’t going to create another Farmville but let’s do something similar.

In this chapter, you are going to skim over the five SOLID principles that Robert C. Martin first introduced in his writing called Principles of OOD. You’ll create a digital garden in this showcase. There was a farmer who planted a garden. E-I-E-I-O.

  $garden = new App\EmptyGarden(20, 30); // this is a pretty good size\        20x30' garden  $items = $garden->items();     ...

Get Design Patterns in PHP and Laravel now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.