Skip to content

Instantly share code, notes, and snippets.

@jazzdan
Forked from anonymous/main.hh
Last active August 29, 2015 14:24
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 jazzdan/b8d10c87570b92b83890 to your computer and use it in GitHub Desktop.
Save jazzdan/b8d10c87570b92b83890 to your computer and use it in GitHub Desktop.
<?hh
class Wrapper<Tval as num> {
private Tval $value;
public function __construct(Tval $value) {
$this->value = $value;
}
public function setValue(Tval $value): void {
$this->value = $value;
}
public function getValue(): Tval {
return $this->value;
}
public function add(num $addend): void {
$this->value += $addend;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment