Skip to content

Commit 76f2007

Browse files
author
Dennis Patzer
committed
see cl 1.5.2
1 parent 231b5ea commit 76f2007

6 files changed

+13
-16
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
composer.lock
2-
.idea
2+
.idea
3+
vendor

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44

55
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [1.5.2] - 2022-02-07
8+
9+
- Fixed: symfony event dispatches to symfony 4+-compliant
10+
711
## [1.5.1] - 2022-02-07
812

913
- Fixed: increased contao minimum version to 4.9

composer.json

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"symfony/cache": "4.4||^5.4",
1111
"symfony/config": "4.4||^5.4",
1212
"symfony/event-dispatcher": "4.4||^5.4",
13+
"symfony/event-dispatcher-contracts": "4.4||^5.4",
1314
"symfony/finder": "^4.4||^5.4",
1415
"symfony/http-foundation": "4.4||^5.4",
1516
"symfony/http-kernel": "4.4||^5.4",

src/Event/BeforeParseTwigTemplateEvent.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* Copyright (c) 2020 Heimrich & Hannot GmbH
4+
* Copyright (c) 2022 Heimrich & Hannot GmbH
55
*
66
* @license LGPL-3.0-or-later
77
*/
@@ -10,7 +10,7 @@
1010

1111
use Contao\Template;
1212
use Contao\Widget;
13-
use Symfony\Component\EventDispatcher\Event;
13+
use Symfony\Contracts\EventDispatcher\Event;
1414

1515
class BeforeParseTwigTemplateEvent extends Event
1616
{

src/Event/BeforeRenderTwigTemplateEvent.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* Copyright (c) 2020 Heimrich & Hannot GmbH
4+
* Copyright (c) 2022 Heimrich & Hannot GmbH
55
*
66
* @license LGPL-3.0-or-later
77
*/
@@ -10,7 +10,7 @@
1010

1111
use Contao\Template;
1212
use Contao\Widget;
13-
use Symfony\Component\EventDispatcher\Event;
13+
use Symfony\Contracts\EventDispatcher\Event;
1414

1515
class BeforeRenderTwigTemplateEvent extends Event
1616
{

src/EventListener/RenderListener.php

+2-11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* Copyright (c) 2021 Heimrich & Hannot GmbH
4+
* Copyright (c) 2022 Heimrich & Hannot GmbH
55
*
66
* @license LGPL-3.0-or-later
77
*/
@@ -155,10 +155,7 @@ public function onParseWidget(string $buffer, Widget $widget): string
155155
}
156156

157157
try {
158-
/** @noinspection PhpMethodParametersCountMismatchInspection */
159-
/** @noinspection PhpParamsInspection */
160158
$event = $this->eventDispatcher->dispatch(
161-
BeforeParseTwigTemplateEvent::NAME,
162159
new BeforeParseTwigTemplateEvent($templateName, $templateData, $widget)
163160
);
164161
} catch (SkipTemplateException $e) {
@@ -194,11 +191,7 @@ public function render($contaoTemplate): string
194191
$twigTemplateData['widget'] = $contaoTemplate;
195192
}
196193

197-
/** @var BeforeRenderTwigTemplateEvent $event */
198-
/** @noinspection PhpMethodParametersCountMismatchInspection */
199-
/** @noinspection PhpParamsInspection */
200194
$event = $this->eventDispatcher->dispatch(
201-
BeforeRenderTwigTemplateEvent::NAME,
202195
new BeforeRenderTwigTemplateEvent($twigTemplateName, $twigTemplateData, $twigTemplatePath, $contaoTemplate)
203196
);
204197

@@ -225,10 +218,7 @@ public function prepareContaoTemplate(Template $contaoTemplate): void
225218
$templateData = $contaoTemplate->getData();
226219

227220
try {
228-
/** @noinspection PhpMethodParametersCountMismatchInspection */
229-
/** @noinspection PhpParamsInspection */
230221
$event = $this->eventDispatcher->dispatch(
231-
BeforeParseTwigTemplateEvent::NAME,
232222
new BeforeParseTwigTemplateEvent($templateName, $templateData, $contaoTemplate)
233223
);
234224
} catch (SkipTemplateException $e) {
@@ -259,6 +249,7 @@ private function getTemplates(): array
259249
if (!$this->templates) {
260250
$this->templates = $this->templateLocator->getTemplates(false);
261251
}
252+
262253
return $this->templates;
263254
}
264255
}

0 commit comments

Comments
 (0)