Last active
September 5, 2023 03:06
-
-
Save mcsee/cd465eb9ca4f2771fb3dc5e30dc491cc 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 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