File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -873,34 +873,40 @@ function combine(int $val1, int $val2)
873873** [ ⬆ back to top] ( #table-of-contents ) **
874874
875875### Remove dead code
876+
876877Dead code is just as bad as duplicate code. There's no reason to keep it in
877878your codebase. If it's not being called, get rid of it! It will still be safe
878879in your version history if you still need it.
879880
880881** Bad:**
882+
881883``` php
882- function oldRequestModule($url) {
884+ function oldRequestModule($url)
885+ {
883886 // ...
884887}
885888
886- function newRequestModule($url) {
889+ function newRequestModule($url)
890+ {
887891 // ...
888892}
889893
890894$request = newRequestModule($requestUrl);
891895inventoryTracker('apples', $request, 'www.inventory-awesome.io');
892-
893896```
894897
895- ** Good** :
898+ ** Good:**
899+
896900``` php
897- function requestModule($url) {
901+ function requestModule($url)
902+ {
898903 // ...
899904}
900905
901906$request = requestModule($requestUrl);
902907inventoryTracker('apples', $request, 'www.inventory-awesome.io');
903908```
909+
904910** [ ⬆ back to top] ( #table-of-contents ) **
905911
906912
You can’t perform that action at this time.
0 commit comments