File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
-
3
2
namespace Barryvdh \Debugbar \DataCollector ;
4
3
5
4
use DebugBar \DataCollector \TimeDataCollector ;
@@ -15,6 +14,7 @@ public function __construct($requestStartTime = null){
15
14
parent ::__construct ($ requestStartTime );
16
15
$ this ->exporter = new ValueExporter ();
17
16
}
17
+
18
18
public function onWildcardEvent ()
19
19
{
20
20
$ args = func_get_args ();
@@ -40,7 +40,8 @@ protected function getCurrentEvent($args)
40
40
return $ event ;
41
41
}
42
42
43
- protected function prepareParams ($ params ){
43
+ protected function prepareParams ($ params )
44
+ {
44
45
$ data = array ();
45
46
foreach ($ params as $ key => $ value ) {
46
47
if (is_object ($ value ) && method_exists ($ value , 'toArray ' )) {
@@ -51,6 +52,13 @@ protected function prepareParams($params){
51
52
return $ data ;
52
53
}
53
54
55
+ public function collect ()
56
+ {
57
+ $ data = parent ::collect ();
58
+ $ data ['nb_measures ' ] = count ($ data ['measures ' ]);
59
+ return $ data ;
60
+ }
61
+
54
62
public function getName ()
55
63
{
56
64
return 'event ' ;
@@ -64,8 +72,11 @@ public function getWidgets()
64
72
"widget " => "PhpDebugBar.Widgets.TimelineWidget " ,
65
73
"map " => "event " ,
66
74
"default " => "{} "
75
+ ),
76
+ 'events:badge ' => array (
77
+ 'map ' => 'event.nb_measures ' ,
78
+ 'default ' => 0
67
79
)
68
80
);
69
81
}
70
-
71
82
}
You can’t perform that action at this time.
0 commit comments