1
0
mirror of https://github.com/jupeter/clean-code-php.git synced 2025-09-25 13:39:04 +02:00
change 'Single Responsibility Pattern' to 'Single Responsibility Principle' in `Prefer final classes` chapter
This commit is contained in:
Ilyes Chouia
2021-05-25 14:12:39 +01:00
committed by GitHub
parent 5467c3a973
commit b12e986703

View File

@@ -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.