Last active
August 23, 2023 01:11
-
-
Save mcsee/66738047685e798a4e4008e291dcff70 to your computer and use it in GitHub Desktop.
This file contains 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
<? | |
final class Poll { | |
function _construct( | |
array $questions, | |
bool $annonymousAllowed = false, | |
$validationPolicy = 'Normal') { | |
if ($validationPolicy == 'Normal') { | |
$validationPolicy = new NormalValidationPolicy(); | |
} | |
// ... | |
} | |
} | |
// Valid | |
new Poll([]); | |
new Poll([], true); | |
new Poll([], true , new NormalValidationPolicy()); | |
new Poll([], , new StrictValidationPolicy()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment