Created
November 29, 2020 00:15
-
-
Save paramientos/7ec194ee35c9f82753af2f720c146b04 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 | |
// PHP 7 | |
class FormRenderer | |
{ | |
private ThemeSystem $theme; | |
private UserRepository $users; | |
private ModuleSystem $modules; | |
public function __construct(ThemeSystem $theme, UserRepository $users, ModuleSystem $modules) { | |
$this->theme = $theme; | |
$this->users = $users; | |
$this->modules = $modules; | |
} | |
public function renderForm(Form $form): string | |
{ | |
// ... | |
} | |
} | |
// As of PHP 8 | |
class FormRenderer | |
{ | |
public function __construct( | |
private ThemeSystem $theme, | |
private UserRepository $users, | |
private ModuleSystem $modules, | |
) { } | |
public function renderForm(Form $form): string | |
{ | |
// ... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment