mirror of
https://github.com/jupeter/clean-code-php.git
synced 2025-10-01 00:16:42 +02:00
Merge pull request #9 from Vlassiuk/master
no need for minus before variable
This commit is contained in:
12
README.md
12
README.md
@@ -519,7 +519,7 @@ would be much better to use singleton design pattern and simple set configuratio
|
|||||||
```php
|
```php
|
||||||
function config() {
|
function config() {
|
||||||
return [
|
return [
|
||||||
'foo': 'bar',
|
'foo' => 'bar',
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@@ -788,7 +788,7 @@ class BankAccount {
|
|||||||
$bankAccount = new BankAccount();
|
$bankAccount = new BankAccount();
|
||||||
|
|
||||||
// Buy shoes...
|
// Buy shoes...
|
||||||
$bankAccount->withdrawBalance(-$shoesPrice);
|
$bankAccount->withdrawBalance($shoesPrice);
|
||||||
|
|
||||||
// Get balance
|
// Get balance
|
||||||
$balance = $bankAccount->getBalance();
|
$balance = $bankAccount->getBalance();
|
||||||
@@ -1168,7 +1168,7 @@ class Manager {
|
|||||||
/** @var WorkerInterface $worker **/
|
/** @var WorkerInterface $worker **/
|
||||||
private $worker;
|
private $worker;
|
||||||
|
|
||||||
public void setWorker(WorkerInterface $worker) {
|
public function setWorker(WorkerInterface $worker) {
|
||||||
$this->worker = $worker;
|
$this->worker = $worker;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1202,7 +1202,7 @@ class Worker implements WorkableInterface, FeedableInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class Robot implements WorkableInterface {
|
class Robot implements WorkableInterface {
|
||||||
public void work() {
|
public function work() {
|
||||||
// ....working
|
// ....working
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1296,11 +1296,11 @@ class Manager {
|
|||||||
/** @var Worker $worker **/
|
/** @var Worker $worker **/
|
||||||
private $worker;
|
private $worker;
|
||||||
|
|
||||||
public void __construct(WorkerInterface $worker) {
|
public function __construct(WorkerInterface $worker) {
|
||||||
$this->worker = $worker;
|
$this->worker = $worker;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void manage() {
|
public function manage() {
|
||||||
$this->worker->work();
|
$this->worker->work();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user