Skip to content

Instantly share code, notes, and snippets.

@ivastly
Last active December 11, 2019 19:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivastly/9dc0ebdc94d84bc7516f2ad0006953f0 to your computer and use it in GitHub Desktop.
Save ivastly/9dc0ebdc94d84bc7516f2ad0006953f0 to your computer and use it in GitHub Desktop.
<?php
namespace Ivastly\GoAopHelloWorld\BankingSystem;
use League\CLImate\CLImate;
class Bank
{
/** @var CLImate */
private $climate;
public function __construct(CLImate $climate)
{
$this->climate = $climate;
}
public function sendMoney(int $amount, string $recipient): void
{
$this->climate->backgroundGreen("Bank: {$amount}€ was sent to $recipient");
}
public function withdrawMoney(int $amount, string $payer): void
{
$this->climate->backgroundRed("Bank: {$amount}€ was deducted from $payer account");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment