1
0
mirror of https://github.com/jupeter/clean-code-php.git synced 2025-10-01 00:16:42 +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**: **Good**:
```php ```php
$name = 'Ryan McDermott';
function splitIntoFirstAndLastName($name) { function splitIntoFirstAndLastName($name) {
return preg_split('/ /', $name); return preg_split('/ /', $name);
} }
@@ -970,8 +968,9 @@ your codebase.
```php ```php
class UserSettings { class UserSettings {
private $user; private $user;
public function __construct($user) { public function __construct($user) {
$this->user = user; $this->user = $user;
} }
public function changeSettings($settings) { public function changeSettings($settings) {
@@ -990,8 +989,9 @@ class UserSettings {
```php ```php
class UserAuth { class UserAuth {
private $user; private $user;
public function __construct($user) { public function __construct($user) {
$this->user = user; $this->user = $user;
} }
public function verifyCredentials() { public function verifyCredentials() {
@@ -1002,6 +1002,7 @@ class UserAuth {
class UserSettings { class UserSettings {
private $user; private $user;
public function __construct($user) { public function __construct($user) {
$this->user = $user; $this->user = $user;
$this->auth = new UserAuth($user); $this->auth = new UserAuth($user);