Skip to content

Commit b51dd4c

Browse files
author
roadiz-ci
committed
refactor(filesystem): Replace file_get_contents with Filesystem component for improved file handling
1 parent 6f4b665 commit b51dd4c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/Vite/JsonManifestResolver.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Psr\Cache\CacheItemPoolInterface;
88
use Symfony\Component\Asset\Packages;
99
use Symfony\Component\DependencyInjection\Attribute\Autowire;
10+
use Symfony\Component\Filesystem\Filesystem;
1011

1112
final readonly class JsonManifestResolver
1213
{
@@ -40,7 +41,7 @@ private function getManifest(): array
4041
throw new \RuntimeException(sprintf('%s manifest not found', $manifestPath));
4142
}
4243
$cacheItem->set(\json_decode(
43-
file_get_contents($manifestPath) ?: throw new \RuntimeException('Unable to load manifest file.'),
44+
(new Filesystem())->readFile($manifestPath),
4445
true,
4546
flags: JSON_THROW_ON_ERROR
4647
));

0 commit comments

Comments
 (0)