public function __construct($type, $data) { if (is_numeric($type)) { $this->type = $this->convertNumericType($type); } else { $this->type = $type; } $this->data = $data; }