Skip to content

Commit fb4dd15

Browse files
committed
fixup! Add new LoadAdditionalScriptsEvent
1 parent eedc25c commit fb4dd15

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

apps/files/lib/Listener/LegacyLoadAdditionalScriptsAdapter.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,25 @@
2626

2727
use OCA\Files\Event\LoadAdditionalScriptsEvent;
2828
use OCP\EventDispatcher\Event;
29+
use OCP\EventDispatcher\IEventDispatcher;
2930
use OCP\EventDispatcher\IEventListener;
30-
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
31-
use Symfony\Component\EventDispatcher\GenericEvent;
3231

3332
class LegacyLoadAdditionalScriptsAdapter implements IEventListener {
3433

35-
/** @var EventDispatcherInterface */
36-
private $legacyDispatcher;
34+
/** @var IEventDispatcher */
35+
private $dispatcher;
3736

38-
public function __construct(EventDispatcherInterface $legacyDispatcher) {
39-
$this->legacyDispatcher = $legacyDispatcher;
37+
public function __construct(IEventDispatcher $legacyDispatcher) {
38+
$this->dispatcher = $legacyDispatcher;
4039
}
4140

4241
public function handle(Event $event): void {
4342
if (!($event instanceof LoadAdditionalScriptsEvent)) {
4443
return;
4544
}
4645

47-
$legacyEvent = new GenericEvent(null, ['hiddenFields' => []]);
48-
$this->legacyDispatcher->dispatch('OCA\Files::loadAdditionalScripts', $legacyEvent);
46+
$legacyEvent = new Event(null, ['hiddenFields' => []]);
47+
$this->dispatcher->dispatch('OCA\Files::loadAdditionalScripts', $legacyEvent);
4948

5049
$hiddenFields = $legacyEvent->getArgument('hiddenFields');
5150
foreach ($hiddenFields as $name => $value) {

0 commit comments

Comments
 (0)