From b12e9867039be9cb85f0d3d2421006219ae17a4e Mon Sep 17 00:00:00 2001 From: Ilyes Chouia Date: Tue, 25 May 2021 14:12:39 +0100 Subject: [PATCH 1/2] fix typo change 'Single Responsibility Pattern' to 'Single Responsibility Principle' in `Prefer final classes` chapter --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bf1becc..2d94352 100644 --- a/README.md +++ b/README.md @@ -1511,13 +1511,14 @@ $car->dump(); **[⬆ back to top](#table-of-contents)** -### Prefer final classes +### Prefer +classes The `final` should be used whenever possible: 1. It prevents uncontrolled inheritance chain. 2. It encourages [composition](#prefer-composition-over-inheritance). -3. It encourages the [Single Responsibility Pattern](#single-responsibility-principle-srp). +3. It encourages the [Single Responsibility Principle](#single-responsibility-principle-srp). 4. It encourages developers to use your public methods instead of extending the class to get access on protected ones. 5. It allows you to change your code without any break of applications that use your class. From c6808b9448aebcf4a50afff1027e97e380fde5c9 Mon Sep 17 00:00:00 2001 From: Ilyes Chouia Date: Tue, 25 May 2021 14:16:05 +0100 Subject: [PATCH 2/2] fix link issue --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 2d94352..149f49c 100644 --- a/README.md +++ b/README.md @@ -1511,8 +1511,7 @@ $car->dump(); **[⬆ back to top](#table-of-contents)** -### Prefer -classes +### Prefer final classes The `final` should be used whenever possible: