Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2
3namespace Drupal\visitors;
4
5/**
6 * Detects the device type.
7 *
8 * @package Drupal\visitors
9 */
10interface VisitorsDeviceInterface {
11
12  /**
13   * Bulk updates missing device information.
14   *
15   * @param string $user_agent
16   *   The user agent string.
17   *
18   * @return int
19   *   The number of records updated.
20   */
21  public function bulkUpdate(string $user_agent): int;
22
23  /**
24   * Gets the unique user agents.
25   *
26   * @return array
27   *   The unique user agents.
28   */
29  public function getUniqueUserAgents(): array;
30
31  /**
32   * Sets the device fields.
33   *
34   * @param array $fields
35   *   The fields array.
36   * @param string $user_agent
37   *   The user agent string.
38   * @param array|null $server
39   *   The server array.
40   */
41  public function doDeviceFields(array &$fields, string $user_agent, ?array $server = NULL): void;
42
43  /**
44   * Gets the device type.
45   *
46   * @param string $class_name
47   *   The class name of the library.
48   *
49   * @return bool
50   *   The device type.
51   */
52  public function hasLibrary($class_name = 'DeviceDetector\ClientHints'): bool;
53
54}