Adjusted hook events for a simpler interface and wrapped in a provider.

This commit is contained in:
Andrey Savchenko committed 2018-02-13 17:26:41 +02:00
1 parent 06e3bb4657
commit c74051e87d
13 files changed
+223 -234

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
<?php
namespace Rarst\Laps\Provider;
use Pimple\Container;
use Pimple\ServiceProviderInterface;
use Rarst\Laps\Event\Core_Events;
use Rarst\Laps\Event\Genesis_Events;
use Rarst\Laps\Event\Hybrid_Events;
use Rarst\Laps\Event\THA_Events;
use Rarst\Laps\Event\Yoast_Events;
class Hook_Event_Provider implements ServiceProviderInterface {
public function register( Container $pimple ) {
$pimple['hook.events'] = function () {
return [
'core' => new Core_Events(),
'genesis' => new Genesis_Events(),
'hybrid' => new Hybrid_Events(),
'tha' => new THA_Events(),
'yoast' => new Yoast_Events(),
];
};
}
}
+1 -1
View File
@@ -21,7 +21,7 @@ class Record_Provider implements ServiceProviderInterface, Bootable_Provider_Int
$pimple['collectors'] = function ( Laps $laps ) {
return [
new Hook_Record_Collector( $laps['stopwatch'] ),
new Hook_Record_Collector( $laps['hook.events'], $laps['stopwatch'] ),
new Http_Record_Collector( $laps['stopwatch'] ),
new Sql_Record_Collector(),
];