Total Complexity | 6 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | trait ClientCommon |
||
8 | { |
||
9 | use Extensible; |
||
10 | |||
11 | /** |
||
12 | * Get the client name/identifier for this client module |
||
13 | * @return string |
||
14 | * @throws \Exception |
||
15 | */ |
||
16 | public function getClientName(): string |
||
17 | { |
||
18 | if ($this->clientName === '') { |
||
19 | throw new \Exception("No client name defined for monitoring client"); |
||
20 | } |
||
21 | return $this->clientName; |
||
22 | } |
||
23 | |||
24 | /** |
||
25 | * Get the friendly name for this client module |
||
26 | * @return string |
||
27 | * @throws \Exception |
||
28 | */ |
||
29 | public function getClientTitle(): string |
||
30 | { |
||
31 | if ($this->config()->get('client_title')) { |
||
|
|||
32 | return $this->config()->get('client_title'); |
||
33 | } |
||
34 | return $this->getClientName(); |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * Get an array of warning messages |
||
39 | * @param $data |
||
40 | * @return array|false |
||
41 | */ |
||
42 | public function getWarnings($data) |
||
47 | } |
||
48 | } |
||
49 |