Skip to content

Commit a69fb97

Browse files
committed
Run cs fixer which apparently has opinions on constant order.
1 parent 990897a commit a69fb97

2 files changed

Lines changed: 30 additions & 31 deletions

File tree

src/Releases/VersionLogos.php

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,6 @@
99
*/
1010
class VersionLogos
1111
{
12-
private const array MAPPING = [
13-
'8.1' => self::LOGO_81,
14-
'8.2' => self::LOGO_82,
15-
'8.3' => self::LOGO_83,
16-
'8.4' => self::LOGO_84,
17-
'8.5' => self::LOGO_85,
18-
];
19-
20-
public static function getLogo(string $version, string $color = 'currentColor', string $highlight = '#4F5B93', string $style = ''): ?string
21-
{
22-
$found = self::MAPPING[$version] ?? null;
23-
if (!$found) {
24-
return null;
25-
}
26-
27-
$replace = [
28-
'{{fill}}' => $color,
29-
'{{highlight}}' => $highlight,
30-
'{{style}}' => $style,
31-
];
32-
33-
return str_replace(array_keys($replace), array_values($replace), $found);
34-
}
35-
3612
public const LOGO_85 = <<<SVG
3713
<svg style="{{style}}" width="467" height="133" viewBox="0 0 467 133" fill="none" xmlns="http://www.w3.org/2000/svg" >
3814
<path fill-rule="evenodd" clip-rule="evenodd" d="M21.7998 125.799H0.799805L19.4998 29.6992H59.7998C71.8998 29.6992 80.7998 32.8992 86.2998 39.1992C91.8998 45.5992 93.4998 54.3992 91.2998 65.8992C90.3998 70.5992 88.7998 74.8992 86.6998 78.7992C84.4998 82.6992 81.6998 86.2992 78.1998 89.4992C73.9998 93.3992 69.3998 96.1992 64.2998 97.8992C59.1998 99.5992 52.6998 100.399 44.6998 100.399H26.6998L21.7998 125.799ZM67.6998 49.1992C64.9998 46.2992 59.6998 44.7992 51.7998 44.7992H37.4998L29.6998 85.0992H42.3998C50.7998 85.0992 57.0998 83.4992 61.2998 80.2992C65.3998 77.0992 68.1998 71.7992 69.6998 64.3992C70.9998 57.1992 70.2998 52.1992 67.6998 49.1992Z" fill="white"/>
@@ -136,4 +112,27 @@ public static function getLogo(string $version, string $color = 'currentColor',
136112
</svg>
137113
SVG;
138114

115+
public const array MAPPING = [
116+
'8.1' => self::LOGO_81,
117+
'8.2' => self::LOGO_82,
118+
'8.3' => self::LOGO_83,
119+
'8.4' => self::LOGO_84,
120+
'8.5' => self::LOGO_85,
121+
];
122+
123+
public static function getLogo(string $version, string $color = 'currentColor', string $highlight = '#4F5B93', string $style = ''): ?string
124+
{
125+
$found = self::MAPPING[$version] ?? null;
126+
if (!$found) {
127+
return null;
128+
}
129+
130+
$replace = [
131+
'{{fill}}' => $color,
132+
'{{highlight}}' => $highlight,
133+
'{{style}}' => $style,
134+
];
135+
136+
return str_replace(array_keys($replace), array_values($replace), $found);
137+
}
139138
}

src/Themes/ThemeRenderer.php

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

77
class ThemeRenderer
88
{
9-
private function safe(string|int|float $value): string
10-
{
11-
return htmlspecialchars((string)$value);
12-
}
13-
149
/**
1510
* @param ClickableCard[] $cards
1611
*/
@@ -22,7 +17,7 @@ public function clickableCards(
2217
string $cssClass = 'gst-default-card',
2318
string $cssImage = 'gst-card-title-icon',
2419
): string {
25-
return Utils::bufferOutput(function() use ($cards, $width, $id, $shuffleLimit, $cssClass, $cssImage) { ?>
20+
return Utils::bufferOutput(function () use ($cards, $width, $id, $shuffleLimit, $cssClass, $cssImage): void { ?>
2621
<ul class="gst-cgrid" style="grid-template-columns: repeat(auto-fit, minmax(<?= $width ?>px, 1fr));)" id="<?= $id ?>">
2722
<?php foreach ($cards as $card) { ?>
2823
<li class="gst-cgrid-card gst-card gst-navcard <?= $cssClass ?> gst-apply-theme">
@@ -69,7 +64,7 @@ class="<?= $cssImage ?>"
6964

7065
public function sectionHeader(string $title, string $subtitle = ''): string
7166
{
72-
return Utils::bufferOutput(function() use ($title, $subtitle) { ?>
67+
return Utils::bufferOutput(function () use ($title, $subtitle): void { ?>
7368
<hgroup class="gst-section-title">
7469
<h2><?= $this->safe($title) ?></h2>
7570

@@ -80,4 +75,9 @@ public function sectionHeader(string $title, string $subtitle = ''): string
8075
<?php
8176
});
8277
}
78+
79+
private function safe(string|int|float $value): string
80+
{
81+
return htmlspecialchars((string)$value);
82+
}
8383
}

0 commit comments

Comments
 (0)