11<?php
22
3+ /*
4+ * This file is part of the Symfony package.
5+ *
6+ * (c) Fabien Potencier <fabien@symfony.com>
7+ *
8+ * For the full copyright and license information, please view the LICENSE
9+ * file that was distributed with this source code.
10+ */
11+
312namespace Symfony \Component \AssetMapper \ImportMap ;
413
514use Symfony \Component \AssetMapper \AssetMapperInterface ;
@@ -19,8 +28,7 @@ public function __construct(
1928 private readonly AssetMapperInterface $ assetMapper ,
2029 private readonly PublicAssetsPathResolverInterface $ assetsPathResolver ,
2130 private readonly ImportMapConfigReader $ importMapConfigReader ,
22- )
23- {
31+ ) {
2432 }
2533
2634 /**
@@ -43,8 +51,8 @@ public function getEntrypointNames(): array
4351 * @param string[] $entrypointNames
4452 *
4553 * @return array<string, array{path: string, type: string, preload?: bool}>
46- * @internal
4754 *
55+ * @internal
4856 */
4957 public function getImportMapData (array $ entrypointNames ): array
5058 {
@@ -74,11 +82,12 @@ public function getImportMapData(array $entrypointNames): array
7482
7583 /**
7684 * @internal
85+ *
7786 * @return array<string, array{path: string, type: string}>
7887 */
7988 public function getRawImportMapData (): array
8089 {
81- $ dumpedImportMapPath = $ this ->assetsPathResolver ->getPublicFilesystemPath () . '/ ' . self ::IMPORT_MAP_CACHE_FILENAME ;
90+ $ dumpedImportMapPath = $ this ->assetsPathResolver ->getPublicFilesystemPath (). '/ ' . self ::IMPORT_MAP_CACHE_FILENAME ;
8291 if (is_file ($ dumpedImportMapPath )) {
8392 return json_decode (file_get_contents ($ dumpedImportMapPath ), true , 512 , \JSON_THROW_ON_ERROR );
8493 }
@@ -108,11 +117,12 @@ public function getRawImportMapData(): array
108117 * Given an importmap entry name, finds all the non-lazy module imports in its chain.
109118 *
110119 * @internal
120+ *
111121 * @return array<string> The array of import names
112122 */
113123 public function findEagerEntrypointImports (string $ entryName ): array
114124 {
115- $ dumpedEntrypointPath = $ this ->assetsPathResolver ->getPublicFilesystemPath () . '/ ' . sprintf (self ::ENTRYPOINT_CACHE_FILENAME_PATTERN , $ entryName );
125+ $ dumpedEntrypointPath = $ this ->assetsPathResolver ->getPublicFilesystemPath (). '/ ' . sprintf (self ::ENTRYPOINT_CACHE_FILENAME_PATTERN , $ entryName );
116126 if (is_file ($ dumpedEntrypointPath )) {
117127 return json_decode (file_get_contents ($ dumpedEntrypointPath ), true , 512 , \JSON_THROW_ON_ERROR );
118128 }
@@ -209,7 +219,7 @@ private function findAsset(string $path): ?MappedAsset
209219 }
210220
211221 if (str_starts_with ($ path , '. ' )) {
212- $ path = $ this ->importMapConfigReader ->getRootDirectory () . '/ ' . $ path ;
222+ $ path = $ this ->importMapConfigReader ->getRootDirectory (). '/ ' . $ path ;
213223 }
214224
215225 return $ this ->assetMapper ->getAssetFromSourcePath ($ path );
0 commit comments