Passed
Push — MODEL_LIB_240928 ( d6fbb6...55f3e4 )
by Rafael
49:14
created

DolExceptionsCollector   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getWidgets() 0 16 1
1
<?php
2
3
/* Copyright (C) 2023       Laurent Destailleur         <[email protected]>
4
 * Copyright (C) 2024       Rafael San José             <[email protected]>
5
 *
6
 * This program is free software; you can redistribute it and/or modify
7
 * it under the terms of the GNU General Public License as published by
8
 * the Free Software Foundation; either version 3 of the License, or
9
 * (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18
 */
19
20
namespace Dolibarr\Tools\DebugBarCollector;
21
22
use DebugBar\DataCollector\ExceptionsCollector;
23
24
/**
25
 *  \file       htdocs/debugbar/class/DataCollector/DolexceptionsCollector.php
26
 *  \brief      Class for debugbar collection
27
 *  \ingroup    debugbar
28
 */
29
30
/**
31
 * DolExceptionsCollector class
32
 */
33
class DolExceptionsCollector extends ExceptionsCollector
34
{
35
    /**
36
     *  Return widget settings
37
     *
38
     * @return    array       Array
39
     */
40
    public function getWidgets()
41
    {
42
        global $langs;
43
44
        $title = $langs->transnoentities('Exceptions');
45
46
        return array(
47
            "$title" => array(
48
                'icon' => 'bug',
49
                'widget' => 'PhpDebugBar.Widgets.ExceptionsWidget',
50
                'map' => 'exceptions.exceptions',
51
                'default' => '[]'
52
            ),
53
            "$title:badge" => array(
54
                'map' => 'exceptions.count',
55
                'default' => 'null'
56
            )
57
        );
58
    }
59
}
60