1
0
mirror of https://github.com/jupeter/clean-code-php.git synced 2025-09-25 21:49:04 +02:00

use PSR CS

This commit is contained in:
Peter Gribanov
2017-09-05 18:54:01 +03:00
committed by GitHub
parent 35e673e0ca
commit b218f288c8

View File

@@ -819,34 +819,40 @@ function combine(int $val1, int $val2)
**[⬆ back to top](#table-of-contents)**
### Remove dead code
Dead code is just as bad as duplicate code. There's no reason to keep it in
your codebase. If it's not being called, get rid of it! It will still be safe
in your version history if you still need it.
**Bad:**
```php
function oldRequestModule($url) {
function oldRequestModule($url)
{
// ...
}
function newRequestModule($url) {
function newRequestModule($url)
{
// ...
}
$request = newRequestModule($requestUrl);
inventoryTracker('apples', $request, 'www.inventory-awesome.io');
```
**Good**:
**Good:**
```php
function requestModule($url) {
function requestModule($url)
{
// ...
}
$request = requestModule($requestUrl);
inventoryTracker('apples', $request, 'www.inventory-awesome.io');
```
**[⬆ back to top](#table-of-contents)**