Added keys to collectors array.
This commit is contained in:
1 parent
c74051e87d
commit
53efcd28af
2 files changed
+5
-9
No files matched your search
@@ -21,9 +21,9 @@ class Record_Provider implements ServiceProviderInterface, Bootable_Provider_Int
|
|||||||
|
|
||||||
$pimple['collectors'] = function ( Laps $laps ) {
|
$pimple['collectors'] = function ( Laps $laps ) {
|
||||||
return [
|
return [
|
||||||
new Hook_Record_Collector( $laps['hook.events'], $laps['stopwatch'] ),
|
'hook' => new Hook_Record_Collector( $laps['hook.events'], $laps['stopwatch'] ),
|
||||||
new Http_Record_Collector( $laps['stopwatch'] ),
|
'http' => new Http_Record_Collector( $laps['stopwatch'] ),
|
||||||
new Sql_Record_Collector(),
|
'sql' => new Sql_Record_Collector(),
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
namespace Rarst\Laps\Record;
|
namespace Rarst\Laps\Record;
|
||||||
|
|
||||||
use Rarst\Laps\Event\Hook_Event_Config_Interface;
|
use Rarst\Laps\Event\Hook_Event_Config_Interface;
|
||||||
use Rarst\Laps\Events\Laps_Events;
|
|
||||||
use Symfony\Component\Stopwatch\Stopwatch;
|
use Symfony\Component\Stopwatch\Stopwatch;
|
||||||
use Symfony\Component\Stopwatch\StopwatchEvent;
|
use Symfony\Component\Stopwatch\StopwatchEvent;
|
||||||
|
|
||||||
@@ -79,13 +78,10 @@ class Hook_Record_Collector implements Record_Collector_Interface {
|
|||||||
return $input;
|
return $input;
|
||||||
}
|
}
|
||||||
|
|
||||||
$event = wp_parse_args(
|
$event = wp_parse_args( $this->events[ $filter_name ][ $priority ], [
|
||||||
$this->events[ $filter_name ][ $priority ],
|
|
||||||
[
|
|
||||||
'action' => 'start',
|
'action' => 'start',
|
||||||
'category' => null,
|
'category' => null,
|
||||||
]
|
] );
|
||||||
);
|
|
||||||
|
|
||||||
if ( 'stop' === $event['action'] && ! $this->stopwatch->isStarted( $event['event'] ) ) {
|
if ( 'stop' === $event['action'] && ! $this->stopwatch->isStarted( $event['event'] ) ) {
|
||||||
return $input;
|
return $input;
|
||||||
|
|||||||
Reference in new issue
Block a user