Skip to content

Commit cdeaa4d

Browse files
authored
bug: js error use own object extends HTMLElement (#493)
* bug: js error use own object extends HTMLElement * refac: remove unnecessary phpdoc * refac: remove old sf 4 stuff
1 parent 1eb4d47 commit cdeaa4d

File tree

3 files changed

+4
-20
lines changed

3 files changed

+4
-20
lines changed

EventListener/AutoAddMissingTranslations.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Translation\Bundle\EventListener;
1313

14-
use Symfony\Component\HttpKernel\Event\PostResponseEvent;
1514
use Symfony\Component\HttpKernel\Event\TerminateEvent;
1615
use Symfony\Component\Translation\DataCollectorTranslator;
1716
use Translation\Bundle\Service\StorageService;
@@ -32,9 +31,6 @@ final class AutoAddMissingTranslations
3231
*/
3332
private $storage;
3433

35-
/**
36-
* @param DataCollectorTranslator $translator
37-
*/
3834
public function __construct(StorageService $storage, DataCollectorTranslator $translator = null)
3935
{
4036
$this->dataCollector = $translator;
@@ -56,10 +52,3 @@ public function onTerminate(TerminateEvent $event): void
5652
}
5753
}
5854
}
59-
60-
// PostResponseEvent have been renamed into ResponseEvent in sf 4.3
61-
// @see https://github.com/symfony/symfony/blob/master/UPGRADE-4.3.md#httpkernel
62-
// To be removed once sf ^4.3 become the minimum supported version.
63-
if (!class_exists(TerminateEvent::class) && class_exists(PostResponseEvent::class)) {
64-
class_alias(PostResponseEvent::class, TerminateEvent::class);
65-
}

EventListener/EditInPlaceResponseListener.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Translation\Bundle\EventListener;
1313

1414
use Symfony\Component\Asset\Packages;
15-
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
1615
use Symfony\Component\HttpKernel\Event\ResponseEvent;
1716
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
1817
use Translation\Bundle\EditInPlace\ActivatorInterface;
@@ -128,10 +127,3 @@ public function onKernelResponse(ResponseEvent $event): void
128127
$event->getResponse()->setContent($content);
129128
}
130129
}
131-
132-
// FilterResponseEvent have been renamed into ResponseEvent in sf 4.3
133-
// @see https://github.com/symfony/symfony/blob/master/UPGRADE-4.3.md#httpkernel
134-
// To be removed once sf ^4.3 become the minimum supported version.
135-
if (!class_exists(ResponseEvent::class) && class_exists(FilterResponseEvent::class)) {
136-
class_alias(FilterResponseEvent::class, ResponseEvent::class);
137-
}

Resources/public/js/editInPlace.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
*/
99
(function () {
1010
if (typeof customElements.define !== "undefined") {
11-
customElements.define("x-trans", HTMLElement);
11+
// it is not possible to use HTMLElement directly
12+
class XTrans extends HTMLElement {}
13+
14+
customElements.define("x-trans", XTrans);
1215

1316
return;
1417
}

0 commit comments

Comments
 (0)