Created
January 17, 2020 17:01
-
-
Save mayronceccon/2cc0efe7371b0839a1d5a133b14aa487 to your computer and use it in GitHub Desktop.
Tratamento de pronunciamentos do governo Bolsonaro
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 | |
| use \Random\Apologies; | |
| use \Random\Minister; | |
| use \Random\Crisis; | |
| use \Minister\Pronouncement; | |
| class Pronouncement | |
| { | |
| private $minister; | |
| private $pronouncement; | |
| public function __construct(Minister &$minister, Pronouncement $pronouncement) | |
| { | |
| $this->minister = $minister; | |
| $this->pronouncement = $pronouncement; | |
| } | |
| public function send() | |
| { | |
| try { | |
| $this->pronouncement->show(); | |
| if ($this->gaveShit()) { | |
| throw new Error(); | |
| } | |
| throw new Exception(); | |
| } catch (Exception $e) { | |
| new Crisis(); | |
| } catch (Error $e) { | |
| new Crisis(); | |
| $this->minister = new Minister(); | |
| } finally { | |
| new Apologies(); | |
| } | |
| } | |
| private function gaveShit() | |
| { | |
| return $this->pronouncement->repercussion(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment