Skip to content

Instantly share code, notes, and snippets.

@mcsee

mcsee/optionals.php

Last active Nov 7, 2020
Embed
What would you like to do?
<?
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