Skip to content

Instantly share code, notes, and snippets.

@mcsee
Last active September 5, 2023 03:06
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/cd465eb9ca4f2771fb3dc5e30dc491cc to your computer and use it in GitHub Desktop.
Save mcsee/cd465eb9ca4f2771fb3dc5e30dc491cc to your computer and use it in GitHub Desktop.
<?
final class Window {
private $width;
private $height;
private $children;
public function width() {
return $this->width;
}
public function area() {
return $this->height * $this->width;
}
public function addChildren($aChild) {
// Do not expose internal attributes
return $this->children[] = $aChild;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment