Last active
December 24, 2023 15:34
-
-
Save mcsee/5d67de4e22f76db964ae06ae33dad6de 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 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