*/ final class ClickTracking { private $active; public static function create(array $data): self { $active = $data['active'] ?? null; $model = new self(); $model->active = 'htmlonly' === $active ? $active : ($active ? 'yes' : 'no'); return $model; } private function __construct() { } public function getActive(): ?string { return $this->active; } public function isActive(): bool { return 'yes' === $this->getActive(); } public function isHtmlOnly(): bool { return 'htmlonly' === $this->getActive(); } }