From 8a64dfc5517b01e7bf4e7ab1534a78fe4a8272f0 Mon Sep 17 00:00:00 2001 From: Peter Gribanov Date: Tue, 12 Sep 2017 10:57:32 +0300 Subject: [PATCH] change the title of encapsulation section --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a472e34..9ad7552 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ * [Avoid type-checking (part 2)](#avoid-type-checking-part-2) * [Remove dead code](#remove-dead-code) 4. [Objects and Data Structures](#objects-and-data-structures) - * [Use getters and setters](#use-getters-and-setters) + * [Use object encapsulation](#use-object-encapsulation) * [Make objects have private/protected members](#make-objects-have-privateprotected-members) 5. [Classes](#classes) * [Use method chaining](#use-method-chaining) @@ -1083,7 +1083,7 @@ inventoryTracker('apples', $request, 'www.inventory-awesome.io'); ## Objects and Data Structures -### Use getters and setters +### Use object encapsulation In PHP you can set `public`, `protected` and `private` keywords for methods. Using it, you can control properties modification on an object. @@ -1097,8 +1097,7 @@ to look up and change every accessor in your codebase. * You can lazy load your object's properties, let's say getting it from a server. -Additionally, this is part of Open/Closed principle, from object-oriented -design principles. +Additionally, this is part of [Open/Closed](#openclosed-principle-ocp) principle. **Bad:**