Skip to content

Instantly share code, notes, and snippets.

@delineas
Last active September 9, 2019 18:41
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 delineas/ce96d14e3994f65fe7a36cf23cba209a to your computer and use it in GitHub Desktop.
Save delineas/ce96d14e3994f65fe7a36cf23cba209a to your computer and use it in GitHub Desktop.
Reto Refactorización WRP 34
<?php
class Payment {
// ... mas codigo
function getCantidades()
{
if ($this->isDead)
$result = $this->deadAmount();
else {
if ($this->isSeparated)
$result = $this->separatedAmount();
else {
if (!$this->isRetired)
$result = $this->normalPayAmount();
else
$result = $this->retiredAmount();
}
}
return $result;
}
// ... mas codigo
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment