From 3e660e37ed9a2389ec297672d89b361e0025fe09 Mon Sep 17 00:00:00 2001 From: Dave Hulbert Date: Fri, 8 Aug 2014 12:14:24 +0100 Subject: [PATCH] Tweak example code for PSR-1/PSR-2 coding standard --- pages/Design-Patterns.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pages/Design-Patterns.md b/pages/Design-Patterns.md index 22d85a0..a09e109 100644 --- a/pages/Design-Patterns.md +++ b/pages/Design-Patterns.md @@ -21,18 +21,18 @@ the object you want to use. Consider the following example of the factory patter vehicle_make = $make; - $this->vehicle_model = $model; + $this->vehicleMake = $make; + $this->vehicleModel = $model; } - public function get_make_and_model() + public function getMakeAndModel() { - return $this->vehicle_make . ' ' . $this->vehicle_model; + return $this->vehicleMake . ' ' . $this->vehicleModel; } } @@ -47,7 +47,7 @@ class AutomobileFactory // have the factory create the Automobile object $veyron = AutomobileFactory::create('Bugatti', 'Veyron'); -print_r($veyron->get_make_and_model()); // outputs "Bugatti Veyron" +print_r($veyron->getMakeAndModel()); // outputs "Bugatti Veyron" {% endhighlight %} This code uses a factory to create the Automobile object. There are two possible benefits to building your code this