Skip to content

Commit e664aa3

Browse files
committed
Upgrade phpstan to v2
1 parent 3a16ab4 commit e664aa3

File tree

4 files changed

+31
-24
lines changed

4 files changed

+31
-24
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"sort-packages": true
3737
},
3838
"require-dev": {
39-
"phpstan/phpstan": "^1.12.15",
40-
"phpstan/phpstan-strict-rules": "^1.6.1"
39+
"phpstan/phpstan": "2.1.1",
40+
"phpstan/phpstan-strict-rules": "2.0.1"
4141
}
4242
}

composer.lock

Lines changed: 18 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Site/PageRenderer.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ private function initTwig(): void
7474
new TwigFilter(
7575
'md',
7676
function (string $value) {
77-
return ($this->makeMarkdownConverter($this->request->colors()?->textLightBg ?? ''))
77+
$linkClass = $this->request->colors()?->textLightBg;
78+
79+
return ($this->makeMarkdownConverter($linkClass ?? ''))
7880
->convert($value)
7981
->getContent();
8082
}

src/Site/SiteBuilder.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ private function deleteDirectory(string $dir): bool
140140
}
141141

142142
foreach ($items as $item) {
143-
if ($item == '.' || $item == '..') {
143+
if ($item === '.' || $item === '..') {
144144
continue;
145145
}
146146

@@ -173,6 +173,12 @@ public static function findPublicCssFilePath(): string
173173
throw new Exception('Could not decode mix-manifest.json');
174174
}
175175

176-
return $manifest['/css/style.css'] ?? '/css/style.css';
176+
$path = $manifest['/css/style.css'] ?? '/css/style.css';
177+
178+
if (!is_string($path)) {
179+
throw new Exception('Could not find /css/style.css in mix-manifest.json');
180+
}
181+
182+
return $path;
177183
}
178184
}

0 commit comments

Comments
 (0)