Skip to content

Commit b940c53

Browse files
committed
run ecs
1 parent 1744c2c commit b940c53

6 files changed

Lines changed: 33 additions & 22 deletions

File tree

src/EventListener/Contao/GeneratePageListener.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@
3131
readonly class GeneratePageListener
3232
{
3333
public function __construct(
34-
private HtmlHeadTagManager $headTagManager,
35-
private RequestStack $requestStack,
36-
private Utils $utils,
37-
private TagHelper $tagHelper,
38-
private InsertTagParser $insertTagParser,
34+
private HtmlHeadTagManager $headTagManager,
35+
private RequestStack $requestStack,
36+
private Utils $utils,
37+
private TagHelper $tagHelper,
38+
private InsertTagParser $insertTagParser,
3939
private ResponseContextAccessor $responseContextAccessor,
4040
) {
4141
}
@@ -57,7 +57,7 @@ public function __invoke(PageModel $pageModel, LayoutModel $layout, PageRegular
5757
}
5858

5959
/**
60-
* Update the contao core response bag based on stored head values
60+
* Update the contao core response bag based on stored head values.
6161
*
6262
* @throws ContainerExceptionInterface
6363
* @throws NotFoundExceptionInterface

src/EventListener/Contao/GetPageLayoutListener.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
readonly class GetPageLayoutListener
2424
{
2525
public function __construct(
26-
private Utils $utils,
27-
private HtmlHeadTagManager $headTagManager,
26+
private Utils $utils,
27+
private HtmlHeadTagManager $headTagManager,
2828
private ImageFactoryInterface $imageFactory,
2929
private ParameterBagInterface $parameterBag,
3030
) {

src/Manager/HtmlHeadTagManager.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ public function getTitleTag(): ?TitleTag
107107
return null;
108108
}
109109
$titleTag = new TitleTag($headBag->getTitle());
110+
110111
return $titleTag;
111112
}
112113

@@ -121,6 +122,7 @@ public function setTitleTag(string|TitleTag|null $title): self
121122
$title = '';
122123
}
123124
$headBag->setTitle(is_string($title) ? $title : $title->getTitle());
125+
124126
return $this;
125127
}
126128

@@ -139,10 +141,12 @@ public function addMetaTag(MetaTag $metaTag): self
139141

140142
if ($headBag && 'description' === $metaTag->getName()) {
141143
$headBag->setMetaDescription($metaTag->getContent());
144+
142145
return $this;
143146
}
144147
if ($headBag && 'robots' === $metaTag->getName()) {
145148
$headBag->setMetaRobots($metaTag->getContent());
149+
146150
return $this;
147151
}
148152

@@ -171,10 +175,12 @@ public function removeMetaTag(string $name): self
171175

172176
if ($headBag && 'description' === $name) {
173177
$headBag->setMetaDescription('');
178+
174179
return $this;
175180
}
176181
if ($headBag && 'robots' === $name) {
177182
$headBag->setMetaRobots('');
183+
178184
return $this;
179185
}
180186

@@ -185,18 +191,19 @@ public function removeMetaTag(string $name): self
185191
return $this;
186192
}
187193

188-
189194
public function addLinkTag(LinkTag $tag): self
190195
{
191196
if ($tag instanceof CanonicalLink) {
192197
$headBag = $this->getHtmlHeadBag();
193198
if (null !== $headBag) {
194199
$headBag->setCanonicalUri($tag->getHref());
200+
195201
return $this;
196202
}
197203
}
198204

199205
$this->linkTags[$tag->getName()] = $tag;
206+
200207
return $this;
201208
}
202209

@@ -217,6 +224,7 @@ public function removeLinkTag(string $name): self
217224

218225
if ($headBag && 'canonical' === $name) {
219226
$headBag->setCanonicalUri('');
227+
220228
return $this;
221229
}
222230

src/Twig/HeadExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ public function getFunctions(): array
2222

2323
return $functions;
2424
}
25-
}
25+
}

src/Twig/HeadRuntime.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@
1212
{
1313
public function __construct(
1414
private HtmlHeadTagManager $tagManager,
15-
private RequestStack $requestStack,
16-
) {}
15+
private RequestStack $requestStack,
16+
) {
17+
}
1718

1819
public function addHeadTag(string|AbstractHeadTag $name, string|Figure|null $value = null): void
1920
{
2021
if ($name instanceof AbstractHeadTag) {
2122
$this->tagManager->addTag($name);
23+
2224
return;
2325
}
2426

@@ -45,6 +47,6 @@ public function addHeadTags(array $tags): void
4547

4648
public function addMetaTag(string $name, string|Figure|null $value = null): void
4749
{
48-
$this->addHeadTag('meta_' . $name, $value);
50+
$this->addHeadTag('meta_'.$name, $value);
4951
}
50-
}
52+
}

src/Twig/IntegrationRuntime.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@
1919
readonly class IntegrationRuntime implements RuntimeExtensionInterface
2020
{
2121
public function __construct(
22-
private HtmlDecoder $htmlDecoder,
22+
private HtmlDecoder $htmlDecoder,
2323
private ContentUrlGenerator $contentUrlGenerator,
24-
private VirtualFilesystemInterface $filesStorage
25-
) {}
24+
private VirtualFilesystemInterface $filesStorage,
25+
) {
26+
}
2627

2728
public function getNewsTags(NewsModel|int $model, mixed $figure = null): array
2829
{
@@ -33,8 +34,8 @@ public function getNewsTags(NewsModel|int $model, mixed $figure = null): array
3334
}
3435
}
3536
$headTags = [
36-
new PropertyMetaTag('og:title', $this->htmlDecoder->inputEncodedToPlainText((string)$model->headline)),
37-
new PropertyMetaTag('og:description', $this->htmlDecoder->inputEncodedToPlainText((string)$model->teaser)),
37+
new PropertyMetaTag('og:title', $this->htmlDecoder->inputEncodedToPlainText((string) $model->headline)),
38+
new PropertyMetaTag('og:description', $this->htmlDecoder->inputEncodedToPlainText((string) $model->teaser)),
3839
new PropertyMetaTag('og:url', $this->contentUrlGenerator->generate($model, referenceType: UrlGeneratorInterface::ABSOLUTE_URL)),
3940
];
4041

@@ -43,11 +44,11 @@ public function getNewsTags(NewsModel|int $model, mixed $figure = null): array
4344
} elseif ($model->addImage && $model->singleSRC) {
4445
try {
4546
$uuid = Uuid::fromBinary($model->singleSRC);
46-
$headTags[] = new PropertyMetaTag('og:image', (string)$this->filesStorage->generatePublicUri($uuid));
47-
} catch (\InvalidArgumentException | UnableToResolveUuidException) {
47+
$headTags[] = new PropertyMetaTag('og:image', (string) $this->filesStorage->generatePublicUri($uuid));
48+
} catch (\InvalidArgumentException|UnableToResolveUuidException) {
4849
}
4950
}
5051

5152
return $headTags;
5253
}
53-
}
54+
}

0 commit comments

Comments
 (0)