Skip to content

Instantly share code, notes, and snippets.

@mcsee
Last active February 29, 2024 13:03
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/559b802e5a6a0e1aa432e594fe5f28dc to your computer and use it in GitHub Desktop.
Save mcsee/559b802e5a6a0e1aa432e594fe5f28dc to your computer and use it in GitHub Desktop.
<?
final class Poll {
function _construct(
array $questions,
AnonnyomousStrategy $annonymousStrategy,
ValidationPolicy $validationPolicy) {
// ...
}
}
// invalid
new Poll([]);
new Poll([], new NoAnonnyomousValidStrategy());
new Poll([], , new StrictValidationPolicy());
// Valid
new Poll(
[],
new NoAnonnyomousValidStrategy(), new StrictValidationPolicy()
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment