Skip to content

Instantly share code, notes, and snippets.

@mcsee
Last active December 24, 2023 15:34
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/5d67de4e22f76db964ae06ae33dad6de to your computer and use it in GitHub Desktop.
Save mcsee/5d67de4e22f76db964ae06ae33dad6de to your computer and use it in GitHub Desktop.
<?
final class Polygon {
private $vertices;
private function __construct(Collection $newVertices) {
if (count($newVertices < 3)) {
throw new
Exception('Cannot create a polygon with less than 3 vertices');
}
$this->vertices = $newVertices;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment