Skip to content

Commit 8d9f19f

Browse files
committed
Merge branch 'main' into feature/update-logo
2 parents 8208ce6 + e6c771d commit 8d9f19f

File tree

4 files changed

+25
-22
lines changed

4 files changed

+25
-22
lines changed

assets-src/styles/sass/60-advanced-components/_collapsibles.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
font-size: rem(15);
2323
font-weight: normal;
2424
line-height: calc(22.5 / 15);
25-
margin-top: 1rem;
25+
color: #333;
2626
order: 2;
2727
width: 100%;
2828
}
@@ -65,4 +65,4 @@
6565
display: none;
6666
}
6767
}
68-
}
68+
}

src/EventSubscriber/FlashMessageSubscriber.php

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
66
use Symfony\Component\HttpFoundation\RequestStack;
7+
use Symfony\Component\HttpFoundation\Session\FlashBagAwareSessionInterface;
78
use Symfony\Component\HttpKernel\Event\ResponseEvent;
89
use Symfony\Component\HttpKernel\HttpKernelInterface;
910
use Symfony\Component\HttpKernel\KernelEvents;
@@ -17,20 +18,20 @@ class FlashMessageSubscriber implements EventSubscriberInterface
1718
public function __construct(RequestStack $requestStack, TranslatorInterface $translator)
1819
{
1920
$this->requestStack = $requestStack;
20-
$this->translator = $translator;
21+
$this->translator = $translator;
2122
}
2223

23-
public static function getSubscribedEvents()
24+
public static function getSubscribedEvents(): array
2425
{
2526
return [
2627
// we want that to run early (before the Session->Cookie transformation)
27-
KernelEvents::RESPONSE => ['onKernelResponse', 10]
28+
KernelEvents::RESPONSE => ['onKernelResponse', 10],
2829
];
2930
}
3031

3132
public function onKernelResponse(ResponseEvent $event)
3233
{
33-
// @todo remove this when we drop support for SF4, see https://github.com/symfony/http-kernel/blob/7.1/CHANGELOG.md#53
34+
// @todo remove this when we drop support for SF4, see https://github.com/symfony/http-kernel/blob/7.1/CHANGELOG.md#53
3435
if (defined('HttpKernelInterface::MASTER_REQUEST') && HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
3536
return;
3637
}
@@ -57,9 +58,11 @@ public function onKernelResponse(ResponseEvent $event)
5758
return;
5859
}
5960

61+
assert($session instanceof FlashBagAwareSessionInterface);
62+
6063
$flashBag = $session->getFlashBag();
6164
// Use peekAll because we want to keep existing messages in the bag
62-
$flashes = $flashBag->peekAll();
65+
$flashes = $flashBag->peekAll();
6366

6467
if (empty($flashes)) {
6568
return;
@@ -68,30 +71,30 @@ public function onKernelResponse(ResponseEvent $event)
6871
$titleKeys = [
6972
'success' => 'successes',
7073
'warning' => 'warnings',
71-
'error' => 'errors',
72-
'info' => 'info'
74+
'error' => 'errors',
75+
'info' => 'info',
7376
];
7477

7578
$existingTitles = array_keys(
7679
array_filter(
7780
$flashes,
78-
fn(string $key) => strpos($key, 'title-') === 0,
81+
fn (string $key) => 0 === strpos($key, 'title-'),
7982
ARRAY_FILTER_USE_KEY
8083
)
8184
);
8285

83-
foreach(array_keys($flashes) as $type) {
86+
foreach (array_keys($flashes) as $type) {
8487
// $type is not a title and its corresponding title doesn't already exist
8588
if (
86-
strpos($type, 'title-') === false &&
87-
!in_array('title-' . $type, $existingTitles) &&
88-
array_key_exists($type, $titleKeys)
89+
false === strpos($type, 'title-')
90+
&& !in_array('title-'.$type, $existingTitles)
91+
&& array_key_exists($type, $titleKeys)
8992
) {
9093
$flashBag->add(
91-
'title-' . $type,
92-
$this->translator->trans('notes.' . $titleKeys[$type] . '.default_title', [], 'w3c_website_templates_bundle')
94+
'title-'.$type,
95+
$this->translator->trans('notes.'.$titleKeys[$type].'.default_title', [], 'w3c_website_templates_bundle')
9396
);
94-
$existingTitles[] = 'title-' . $type;
97+
$existingTitles[] = 'title-'.$type;
9598
}
9699
}
97100
}

src/Twig/TwigExtension.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function __construct(
5959
$this->loginUrlInfo = $loginUrlInfo;
6060
}
6161

62-
public function getFilters()
62+
public function getFilters(): array
6363
{
6464
return [
6565
new TwigFilter('preg_replace', [$this, 'pregReplace']),
@@ -76,7 +76,7 @@ public function getFilters()
7676
];
7777
}
7878

79-
public function getFunctions()
79+
public function getFunctions(): array
8080
{
8181
return [
8282
new TwigFunction('date_range', [$this, 'dateRange']),
@@ -106,7 +106,7 @@ public function pregReplace(string $subject, $pattern, $replacement, int $limit
106106
* @return bool|string
107107
* @throws Exception
108108
*/
109-
public function markupAttrs(string $markup, array $attrs = null)
109+
public function markupAttrs(string $markup, ?array $attrs = null)
110110
{
111111
try {
112112
$xml = new SimpleXMLElement($markup);
@@ -205,7 +205,7 @@ public function dateRange(
205205
string $tz,
206206
string $locale,
207207
bool $utc = false,
208-
string $id = null
208+
?string $id = null
209209
): string {
210210
if ($locale == 'en') {
211211
$locale = 'en-GB';

templates/components/styles/comments.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</time>
1313
</div>
1414
<div class="comment__body">
15-
{% if post.typeHandle == 'importedEntries' %}
15+
{% if post.typeHandle == 'blogPosts_importedEntries' %}
1616
<p>{{ comment.comment|raw }}</p>
1717
{% else %}
1818
<p>{{ comment.comment|nl2br }}</p>

0 commit comments

Comments
 (0)