DeviceDetector\Parser\ParserAbstract::buildByMatch PHP Method

buildByMatch() protected method

protected buildByMatch ( string $item, array $matches ) : string
$item string
$matches array
return string type
    protected function buildByMatch($item, $matches)
    {
        for ($nb = 1; $nb <= 3; $nb++) {
            if (strpos($item, '$' . $nb) === false) {
                continue;
            }
            $replace = isset($matches[$nb]) ? $matches[$nb] : '';
            $item = trim(str_replace('$' . $nb, $replace, $item));
        }
        return $item;
    }