Skip to content

Commit

Permalink
Better Service Worker
Browse files Browse the repository at this point in the history
  • Loading branch information
Spomky committed Feb 6, 2024
1 parent cda04c6 commit adb82b9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
12 changes: 1 addition & 11 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,6 @@ parameters:
count: 1
path: src/Command/CreateServiceWorkerCommand.php

-
message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, array\\|string given\\.$#"
count: 1
path: src/Command/CreateServiceWorkerCommand.php

-
message: "#^Parameter \\#2 \\$targetFile of method Symfony\\\\Component\\\\Filesystem\\\\Filesystem\\:\\:copy\\(\\) expects string, mixed given\\.$#"
count: 1
Expand Down Expand Up @@ -488,9 +483,4 @@ parameters:
-
message: "#^Method SpomkyLabs\\\\PwaBundle\\\\Normalizer\\\\UrlNormalizer\\:\\:supportsNormalization\\(\\) has parameter \\$context with no value type specified in iterable type array\\.$#"
count: 1
path: src/Normalizer/UrlNormalizer.php

-
message: "#^Parameter \\#1 \\$string of function mb_strlen expects string, string\\|null given\\.$#"
count: 1
path: src/Subscriber/PwaDevServerSubscriber.php
path: src/Normalizer/UrlNormalizer.php
2 changes: 1 addition & 1 deletion src/Subscriber/PwaDevServerSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ private function serveWorkboxFile(RequestEvent $event, string $pathInfo): void
if (str_contains($pathInfo, '/..')) {
return;
}
$asset = mb_substr($pathInfo, mb_strlen($this->workboxPublicUrl));
$asset = mb_substr($pathInfo, mb_strlen((string) $this->workboxPublicUrl));
$resource = sprintf('@SpomkyLabsPwaBundle/Resources/workbox-v%s%s', $this->workboxVersion, $asset);
$resourcePath = $this->fileLocator->locate($resource, null, false);
if (is_array($resourcePath)) {
Expand Down

0 comments on commit adb82b9

Please sign in to comment.