Файл: vendor/whichbrowser/parser/src/Analyser/Header/Useragent/Device/Printer.php
Строк: 57
<?php
namespace WhichBrowserAnalyserHeaderUseragentDevice;
use WhichBrowserConstants;
trait Printer
{
private function detectPrinter($ua)
{
if (!preg_match('/(TASKalfa|CanonIJCL|IR-S|PrintSmart|EpsonHello)/ui', $ua)) {
return;
}
/* TASKalfa */
if (preg_match('/TASKalfa ([0-9A-Z]+)/iu', $ua, $match)) {
$this->data->device->setIdentification([
'manufacturer' => 'Kyocera',
'model' => 'TASKalfa ' . $match[1],
'type' => ConstantsDeviceType::PRINTER
]);
}
/* Canon IJ */
if (preg_match('/CanonIJCL/iu', $ua, $match)) {
$this->data->device->setIdentification([
'manufacturer' => 'Canon',
'model' => 'IJ Printer',
'type' => ConstantsDeviceType::PRINTER
]);
}
/* Canon iR S */
if (preg_match('/IR-S/iu', $ua, $match)) {
$this->data->device->setIdentification([
'manufacturer' => 'Canon',
'model' => 'imageRUNNER',
'type' => ConstantsDeviceType::PRINTER
]);
}
/* HP Web PrintSmart */
if (preg_match('/HP Web PrintSmart/iu', $ua, $match)) {
$this->data->device->setIdentification([
'manufacturer' => 'HP',
'model' => 'Web PrintSmart',
'type' => ConstantsDeviceType::PRINTER
]);
}
/* Epson Hello */
if (preg_match('/EpsonHello//iu', $ua, $match)) {
$this->data->device->setIdentification([
'manufacturer' => 'Epson',
'model' => 'Hello',
'type' => ConstantsDeviceType::PRINTER
]);
}
}
}