Skip to content

Commit d361e22

Browse files
author
Tomáš Votruba
authored
Merge pull request #72 from peter-gribanov/remove_dead_code_cs
Correct CS in Remove dead code
2 parents 4682cd8 + b218f28 commit d361e22

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff 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+
876877
Dead code is just as bad as duplicate code. There's no reason to keep it in
877878
your codebase. If it's not being called, get rid of it! It will still be safe
878879
in 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);
891895
inventoryTracker('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);
902907
inventoryTracker('apples', $request, 'www.inventory-awesome.io');
903908
```
909+
904910
**[⬆ back to top](#table-of-contents)**
905911

906912

0 commit comments

Comments
 (0)