}
$event = new LoadAdditionalScriptsEvent();
- $this->eventDispatcher->dispatch(LoadAdditionalScriptsEvent::class, $event);
-
- $this->eventDispatcher->dispatch(LoadSidebar::class, new LoadSidebar());
+ $this->eventDispatcher->dispatchTyped($event);
+ $this->eventDispatcher->dispatchTyped(new LoadSidebar());
// Load Viewer scripts
if (class_exists(LoadViewer::class)) {
$this->eventDispatcher->dispatchTyped(new LoadViewer());
use OCP\EventDispatcher\IEventDispatcher;
use OCP\ILogger;
use OCP\IServerContainer;
+use OCP\WorkflowEngine\Events\LoadSettingsScriptsEvent;
use OCP\WorkflowEngine\IEntity;
use OCP\WorkflowEngine\IEntityCompat;
use OCP\WorkflowEngine\IOperation;
public function register(IRegistrationContext $context): void {
$context->registerServiceAlias('RequestTimeController', RequestTime::class);
$context->registerEventListener(
- 'OCP\WorkflowEngine::loadAdditionalSettingScripts',
+ LoadSettingsScriptsEvent::class,
LoadAdditionalSettingsScriptsListener::class,
-100
);
* @return TemplateResponse
*/
public function getForm() {
+ // @deprecated in 20.0.0: retire this one in favor of the typed event
$this->eventDispatcher->dispatch(
'OCP\WorkflowEngine::loadAdditionalSettingScripts',
new LoadSettingsScriptsEvent()
);
+ $this->eventDispatcher->dispatchTyped(new LoadSettingsScriptsEvent());
$entities = $this->manager->getEntitiesList();
$this->initialStateService->provideInitialState(
*/
public function getDefaultPolicy(): ContentSecurityPolicy {
$event = new AddContentSecurityPolicyEvent($this);
- $this->dispatcher->dispatch(AddContentSecurityPolicyEvent::class, $event);
+ $this->dispatcher->dispatchTyped($event);
$defaultPolicy = new \OC\Security\CSP\ContentSecurityPolicy();
foreach ($this->policies as $policy) {
public function getDefaultPolicy(): FeaturePolicy {
$event = new AddFeaturePolicyEvent($this);
- $this->dispatcher->dispatch(AddFeaturePolicyEvent::class, $event);
+ $this->dispatcher->dispatchTyped($event);
$defaultPolicy = new FeaturePolicy();
foreach ($this->policies as $policy) {