mirror of
https://github.com/jupeter/clean-code-php.git
synced 2025-09-28 15:09:00 +02:00
26
README.md
26
README.md
@@ -4,9 +4,35 @@
|
|||||||
|
|
||||||
1. [Introduction](#introduction)
|
1. [Introduction](#introduction)
|
||||||
2. [Variables](#variables)
|
2. [Variables](#variables)
|
||||||
|
* [Use meaningful and pronounceable variable names](#use-meaningful-and-pronounceable-variable-names)
|
||||||
|
* [Use the same vocabulary for the same type of variable](#use-the-same-vocabulary-for-the-same-type-of-variable)
|
||||||
|
* [Use searchable names (part 1)](#use-searchable-names-part-1)
|
||||||
|
* [Use searchable names (part 2)](#use-searchable-names-part-2)
|
||||||
|
* [Use explanatory variables](#use-explanatory-variables)
|
||||||
|
* [Avoid Mental Mapping](#avoid-mental-mapping)
|
||||||
|
* [Don't add unneeded context](#dont-add-unneeded-context)
|
||||||
|
* [Use default arguments instead of short circuiting or conditionals](#use-default-arguments-instead-of-short-circuiting-or-conditionals)
|
||||||
3. [Functions](#functions)
|
3. [Functions](#functions)
|
||||||
|
* [Function arguments (2 or fewer ideally)](#function-arguments-2-or-fewer-ideally)
|
||||||
|
* [Functions should do one thing](#functions-should-do-one-thing)
|
||||||
|
* [Function names should say what they do](#function-names-should-say-what-they-do)
|
||||||
|
* [Functions should only be one level of abstraction](#functions-should-only-be-one-level-of-abstraction)
|
||||||
|
* [Don't use flags as function parameters](#dont-use-flags-as-function-parameters)
|
||||||
|
* [Avoid Side Effects](#avoid-side-effects)
|
||||||
|
* [Don't write to global functions](#dont-write-to-global-functions)
|
||||||
|
* [Don't use a Singleton pattern](#dont-use-a-singleton-pattern)
|
||||||
|
* [Encapsulate conditionals](#encapsulate-conditionals)
|
||||||
|
* [Avoid negative conditionals](#avoid-negative-conditionals)
|
||||||
|
* [Avoid conditionals](#avoid-conditionals)
|
||||||
|
* [Avoid type-checking (part 1)](#avoid-type-checking-part-1)
|
||||||
|
* [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)
|
4. [Objects and Data Structures](#objects-and-data-structures)
|
||||||
|
* [Use getters and setters](#use-getters-and-setters)
|
||||||
|
* [Make objects have private/protected members](#make-objects-have-privateprotected-members)
|
||||||
5. [Classes](#classes)
|
5. [Classes](#classes)
|
||||||
|
* [Use method chaining](#use-method-chaining)
|
||||||
|
* [Prefer composition over inheritance](#prefer-composition-over-inheritance)
|
||||||
6. [SOLID](#solid)
|
6. [SOLID](#solid)
|
||||||
* [Single Responsibility Principle (SRP)](#single-responsibility-principle-srp)
|
* [Single Responsibility Principle (SRP)](#single-responsibility-principle-srp)
|
||||||
* [Open/Closed Principle (OCP)](#openclosed-principle-ocp)
|
* [Open/Closed Principle (OCP)](#openclosed-principle-ocp)
|
||||||
|
Reference in New Issue
Block a user