<?php
class Whisky {
*private* string *$_name*;
public string $name {
*get {*
return $this->_name;
*}*
*set* {
if (*$value* === '') {
thrown new ValueError('Name must be non-empty');
}
$this->_name = $value;
}
}
public function __construct(string $name) {
$this->name = $name;
}
}