WhichBrowser\Analyser\Header\Useragent\Device\Television::detectGenericTelevisionModels PHP Method

detectGenericTelevisionModels() private method

* Generic model information
    private function detectGenericTelevisionModels($ua)
    {
        if (preg_match('/\\(([^,\\(]+),\\s*([^,\\(]+),\\s*(?:[Ww]ired|[Ww]ireless)\\)/u', $ua, $match)) {
            $vendorName = Data\Manufacturers::identify(Constants\DeviceType::TELEVISION, $match[1]);
            $modelName = trim($match[2]);
            $this->data->device->type = Constants\DeviceType::TELEVISION;
            $this->data->device->identified |= Constants\Id::PATTERN;
            if (!isset($this->data->device->series)) {
                $this->data->device->series = 'Smart TV';
            }
            switch ($vendorName) {
                case 'ARRIS':
                    $this->data->device->manufacturer = 'Arris';
                    $this->data->device->model = $modelName;
                    break;
                case 'LG':
                    $this->data->device->manufacturer = 'LG';
                    switch ($modelName) {
                        case 'WEBOS1':
                        case 'webOS.TV':
                            $this->data->device->series = 'webOS TV';
                            break;
                        case 'NETCAST4':
                        case 'NetCast4.0':
                        case 'GLOBAL-PLAT4':
                            $this->data->device->series = 'NetCast TV 2013';
                            break;
                        default:
                            $this->data->device->model = $modelName;
                            break;
                    }
                    break;
                case 'Google Fiber':
                    $this->data->device->manufacturer = $vendorName;
                    $this->data->device->model = 'TV Box';
                    break;
                case 'Sagemcom':
                    $this->data->device->manufacturer = $vendorName;
                    $this->data->device->series = 'Settopbox';
                    if (preg_match('/^([A-Z]+[0-9]+)/ui', $modelName, $match)) {
                        $this->data->device->model = $match[1];
                        unset($this->data->device->series);
                    }
                    break;
                case 'TiVo':
                    $this->data->device->manufacturer = 'TiVo';
                    $this->data->device->series = 'DVR';
                    break;
                default:
                    $this->data->device->manufacturer = $vendorName;
                    if (!in_array($modelName, ['dvb'])) {
                        $this->data->device->model = $modelName;
                    }
                    break;
            }
        }
    }