Skip to content

Commit 006f2c4

Browse files
author
Tomáš Votruba
authored
Merge pull request piotrplenik#127 from peter-gribanov/balance
Rename methods in BankAccount
2 parents 2d8720c + 27103f4 commit 006f2c4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,7 +1129,7 @@ class BankAccount
11291129
$this->balance = $balance;
11301130
}
11311131

1132-
public function withdrawBalance(int $amount): void
1132+
public function withdraw(int $amount): void
11331133
{
11341134
if ($amount > $this->balance) {
11351135
throw new \Exception('Amount greater than available balance.');
@@ -1138,12 +1138,12 @@ class BankAccount
11381138
$this->balance -= $amount;
11391139
}
11401140

1141-
public function depositBalance(int $amount): void
1141+
public function deposit(int $amount): void
11421142
{
11431143
$this->balance += $amount;
11441144
}
11451145

1146-
public function getBalance(): int
1146+
   public function getBalance(): int
11471147
{
11481148
return $this->balance;
11491149
}
@@ -1152,7 +1152,7 @@ class BankAccount
11521152
$bankAccount = new BankAccount();
11531153

11541154
// Buy shoes...
1155-
$bankAccount->withdrawBalance($shoesPrice);
1155+
$bankAccount->withdraw($shoesPrice);
11561156

11571157
// Get balance
11581158
$balance = $bankAccount->getBalance();

0 commit comments

Comments
 (0)