Last active
February 9, 2022 18:15
-
-
Save tadeubdev/59fc332ba43110afbb88d2bd742bb5c7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class Example | |
| { | |
| private $tipo; | |
| private $valor; | |
| public function __construct($tipo, $valor) | |
| { | |
| $this->tipo = $tipo; | |
| $this->valor = $valor; | |
| } | |
| public function execute($tipoDeUsuario, $ocupacao) | |
| { | |
| if ($this->tipo === 1) { | |
| $this->valor += 50; | |
| } else if ($tipoDeUsuario === TiposDeUsuario::ADMIN) { | |
| $this->valor += 100; | |
| } else if ($ocupacao->getTipo() === 40) { | |
| $this->valor += 200; | |
| } | |
| return $this->valor; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment