public function __construct($isLegacy) { if (!is_bool($isLegacy)) { throw new \Exception('Boolean expected, got ' . gettype($isLegacy)); } $this->isLegacy = $isLegacy; }