1
0
mirror of https://github.com/jupeter/clean-code-php.git synced 2025-09-30 07:59:02 +02:00

Duplicated fixes.

Duplicate variables removed.
Variable names updated.
This commit is contained in:
Emin Şen
2017-09-02 15:57:43 +03:00
committed by GitHub
parent 1db3e5301b
commit cc9896241a

View File

@@ -528,8 +528,6 @@ var_dump($name); // ['Ryan', 'McDermott'];
**Good**:
```php
$name = 'Ryan McDermott';
function splitIntoFirstAndLastName($name) {
return preg_split('/ /', $name);
}
@@ -970,8 +968,9 @@ your codebase.
```php
class UserSettings {
private $user;
public function __construct($user) {
$this->user = user;
$this->user = $user;
}
public function changeSettings($settings) {
@@ -990,8 +989,9 @@ class UserSettings {
```php
class UserAuth {
private $user;
public function __construct($user) {
$this->user = user;
$this->user = $user;
}
public function verifyCredentials() {
@@ -1002,6 +1002,7 @@ class UserAuth {
class UserSettings {
private $user;
public function __construct($user) {
$this->user = $user;
$this->auth = new UserAuth($user);