Skip to content

Instantly share code, notes, and snippets.

@mcsee
Last active March 19, 2026 15:50
Show Gist options
  • Select an option

  • Save mcsee/cd465eb9ca4f2771fb3dc5e30dc491cc to your computer and use it in GitHub Desktop.

Select an option

Save mcsee/cd465eb9ca4f2771fb3dc5e30dc491cc to your computer and use it in GitHub Desktop.
This gist belongs to Clean Code Cookbook http://cleancodecookbook.com By Maximiliano Contieri http://maximilianocontieri.com
<?
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) {
// Don't 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