Added keys to collectors array.

This commit is contained in:
Andrey Savchenko committed 2018-02-13 18:16:41 +02:00
1 parent c74051e87d
commit 53efcd28af
2 files changed
+5 -9

No files matched your search

+3 -3
View File
@@ -21,9 +21,9 @@ class Record_Provider implements ServiceProviderInterface, Bootable_Provider_Int
$pimple['collectors'] = function ( Laps $laps ) {
return [
new Hook_Record_Collector( $laps['hook.events'], $laps['stopwatch'] ),
new Http_Record_Collector( $laps['stopwatch'] ),
new Sql_Record_Collector(),
'hook' => new Hook_Record_Collector( $laps['hook.events'], $laps['stopwatch'] ),
'http' => new Http_Record_Collector( $laps['stopwatch'] ),
'sql' => new Sql_Record_Collector(),
];
};
+2 -6
View File
@@ -3,7 +3,6 @@
namespace Rarst\Laps\Record;
use Rarst\Laps\Event\Hook_Event_Config_Interface;
use Rarst\Laps\Events\Laps_Events;
use Symfony\Component\Stopwatch\Stopwatch;
use Symfony\Component\Stopwatch\StopwatchEvent;
@@ -79,13 +78,10 @@ class Hook_Record_Collector implements Record_Collector_Interface {
return $input;
}
$event = wp_parse_args(
$this->events[ $filter_name ][ $priority ],
[
$event = wp_parse_args( $this->events[ $filter_name ][ $priority ], [
'action' => 'start',
'category' => null,
]
);
] );
if ( 'stop' === $event['action'] && ! $this->stopwatch->isStarted( $event['event'] ) ) {
return $input;