| 1 | <?php |
||
| 5 | class Price |
||
| 6 | { |
||
| 7 | /** @var float */ |
||
| 8 | protected $amount; |
||
| 9 | |||
| 10 | /** @var string */ |
||
| 11 | protected $currency; |
||
| 12 | |||
| 13 | const CURRENCY_SYMBOLS = [ |
||
| 14 | '€' => 'EUR', |
||
| 15 | '$' => 'USD', |
||
| 16 | '£' => 'GBP', |
||
| 17 | // TODO: Add more currency symbols and their codes |
||
| 18 | ]; |
||
| 19 | |||
| 20 | public function __construct($amount, string $currency) |
||
| 26 | |||
| 27 | public function amount(): float |
||
| 31 | |||
| 32 | public function currency(): string |
||
| 36 | |||
| 37 | private function parseCurrency($currency): string |
||
| 45 | |||
| 46 | protected function parseAmount($amount): float |
||
| 50 | |||
| 51 | public function formattedWith(string $currency): string |
||
| 59 | |||
| 60 | public function __toString() |
||
| 64 | } |
||
| 65 |
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.