From 40ca2e5959264ce560bf0d93d47724c80666264c Mon Sep 17 00:00:00 2001 From: Peter Gribanov Date: Fri, 6 Oct 2017 11:11:00 +0300 Subject: [PATCH 1/2] rename methods in BankAccount --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 96757f2..d762d93 100644 --- a/README.md +++ b/README.md @@ -1129,7 +1129,7 @@ class BankAccount $this->balance = $balance; } - public function withdrawBalance(int $amount): void + public function withdraw(int $amount): void { if ($amount > $this->balance) { throw new \Exception('Amount greater than available balance.'); @@ -1138,12 +1138,12 @@ class BankAccount $this->balance -= $amount; } - public function depositBalance(int $amount): void + public function deposit(int $amount): void { $this->balance += $amount; } - public function getBalance(): int + public function balance(): int { return $this->balance; } @@ -1152,10 +1152,10 @@ class BankAccount $bankAccount = new BankAccount(); // Buy shoes... -$bankAccount->withdrawBalance($shoesPrice); +$bankAccount->withdraw($shoesPrice); // Get balance -$balance = $bankAccount->getBalance(); +$balance = $bankAccount->balance(); ``` **[⬆ back to top](#table-of-contents)** From 27103f43efd4dee1fcaf5769071f7264ea75bb12 Mon Sep 17 00:00:00 2001 From: Peter Gribanov Date: Sat, 7 Oct 2017 09:48:29 +0300 Subject: [PATCH 2/2] Rename get balance method --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d762d93..62fd2dc 100644 --- a/README.md +++ b/README.md @@ -1143,7 +1143,7 @@ class BankAccount $this->balance += $amount; } - public function balance(): int +    public function getBalance(): int { return $this->balance; } @@ -1155,7 +1155,7 @@ $bankAccount = new BankAccount(); $bankAccount->withdraw($shoesPrice); // Get balance -$balance = $bankAccount->balance(); +$balance = $bankAccount->getBalance(); ``` **[⬆ back to top](#table-of-contents)**