Skip to content

Commit c633a16

Browse files
committed
fix(src/JavascriptRenderer.php): Update method signature
- Update the method signature of `makeUriRelativeTo()` to accept an array of strings or a string as the parameter. - Update the method documentation to reflect the changes.
1 parent 2a04eea commit c633a16

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

phpstan-baseline.neon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ parameters:
1111
path: src/Http/Controllers/AssetController.php
1212

1313
-
14-
message: "#^Method Guanguans\\\\LaravelSoar\\\\JavascriptRenderer\\:\\:makeUriRelativeTo\\(\\) should return string but returns array\\<int\\<0, max\\>, string\\>\\.$#"
15-
count: 1
14+
message: "#^Variable \\$uri on left side of \\?\\? always exists and is not nullable\\.$#"
15+
count: 2
1616
path: src/JavascriptRenderer.php
1717

1818
-

psalm-baseline.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@
1111
<UnusedVariable>
1212
<code>$contents</code>
1313
</UnusedVariable>
14-
<InvalidReturnType>
15-
<code>makeUriRelativeTo</code>
16-
</InvalidReturnType>
1714
<InvalidReturnStatement>
18-
<code>$uri</code>
1915
<code>$uris</code>
2016
</InvalidReturnStatement>
2117
</file>

src/JavascriptRenderer.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,13 @@ protected function getModifiedTime(?string $type): int
194194
/**
195195
* @noinspection MissingParentCallInspection
196196
*
197-
* @param mixed $uri
198-
* @param mixed $root
197+
* @psalm-suppress InvalidReturnType
198+
* @psalm-suppress MoreSpecificImplementedParamType
199+
*
200+
* @param array<string>|string $uri
201+
* @param mixed|string $root
202+
*
203+
* @return array<string>|string
199204
*/
200205
protected function makeUriRelativeTo($uri, $root)
201206
{

0 commit comments

Comments
 (0)