Skip to content

Instantly share code, notes, and snippets.

@mcsee
Last active August 23, 2023 01:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcsee/66738047685e798a4e4008e291dcff70 to your computer and use it in GitHub Desktop.
Save mcsee/66738047685e798a4e4008e291dcff70 to your computer and use it in GitHub Desktop.
<?
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