Skip to content

Instantly share code, notes, and snippets.

@mcsee

mcsee/goodmodel.php

Last active Apr 27, 2021
Embed
What would you like to do?
<?php
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