This WordPress bundle configures the standalone snicco/better-wp-hooks
library for usage in applications based on snicco/kernel
.
composer install snicco/better-wp-hooks-bundle
This bundle currently has no configuration options.
Add the BetterWPHooksBundle
to your bundles.php
configuration file.
<?php
// /path/to/configuration/bundles.php
use Snicco\Bundle\BetterWPHooks\BetterWPHooksBundle;
use Snicco\Component\Kernel\ValueObject\Environment;
return [
'bundles' => [
Environment::ALL => [
BetterWPHooksBundle::class
]
]
];
You can now lazily resolve the following services after booting the kernel:
use Psr\EventDispatcher\EventDispatcherInterface;
use Snicco\Component\BetterWPHooks\EventMapping\EventMapper;
use Snicco\Component\EventDispatcher\EventDispatcher;
/**
* @var Kernel $kernel
*/
$kernel->boot();
$event_dispatcher = $kernel->container()->make(EventDispatcher::class);
$psr_event_dispatcher = $kernel->container()->make(EventDispatcherInterface::class);
var_dump($event_dispatcher === $psr_event_dispatcher); // true
$event_mapper = $kernel->container()->make(EventMapper::class);
If the snicco/event-dispatcher-testing
package is installed
a TestableEventDispatcher
will automatically be used in the testing environment.
This repository is a read-only split of the development repo of the Snicco project.
This is how you can contribute.
Please report issues in the Snicco monorepo.
If you discover a security vulnerability within BetterWPCache, please follow our disclosure procedure.