From 0b06120c1e29e81763fb119b8b34e10584fca52c Mon Sep 17 00:00:00 2001 From: Peter Gribanov Date: Fri, 15 Sep 2017 17:13:52 +0300 Subject: [PATCH] fix mistakes --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 34fd204..beb9acc 100644 --- a/README.md +++ b/README.md @@ -1160,8 +1160,8 @@ $balance = $bankAccount->getBalance(); ### Make objects have private/protected members * `public` methods and properties are most dangerous for changes, because some outside code may easily rely on them and you can't control what code relies on them. **Modifications in class are dangerous for all users of class.** -* `protected` methods are as dangerous as public, because they are available in scope of any child class. This effectively means that difference between public and protected is only in access mechanism, but encapsulation guarantee remains the same. **Modifications in class are dangerous for all descendant classes.** -* `private` methods are guarantee you that code in your methods is **dangerous to modify only in boundaries of single class** (you are safe for modifications and you won't have [Jenga effect](http://www.urbandictionary.com/define.php?term=Jengaphobia&defid=2494196)). +* `protected` modifier are as dangerous as public, because they are available in scope of any child class. This effectively means that difference between public and protected is only in access mechanism, but encapsulation guarantee remains the same. **Modifications in class are dangerous for all descendant classes.** +* `private` modifier guarantees that code is **dangerous to modify only in boundaries of single class** (you are safe for modifications and you won't have [Jenga effect](http://www.urbandictionary.com/define.php?term=Jengaphobia&defid=2494196)). Therefore, use `private` by default and `public/protected` when you need to provide access for external classes.