1
1
<?php
2
2
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
+ */
10000
11
+
3
12
namespace Symfony \Component \AssetMapper \ImportMap ;
4
13
5
14
use Symfony \Component \AssetMapper \AssetMapperInterface ;
@@ -19,8 +28,7 @@ public function __construct(
19
28
private readonly AssetMapperInterface $ assetMapper ,
20
29
private readonly PublicAssetsPathResolverInterface $ assetsPathResolver ,
21
30
private readonly ImportMapConfigReader $ importMapConfigReader ,
22
- )
23
- {
31
+ ) {
24
32
}
25
33
26
34
/**
@@ -43,8 +51,8 @@ public function getEntrypointNames(): array
43
51
* @param string[] $entrypointNames
44
52
*
45
53
* @return array<string, array{path: string, type: string, preload?: bool}>
46
- * @internal
47
54
*
55
+ * @internal
48
56
*/
49
57
public function getImportMapData (array $ entrypointNames ): array
50
58
{
@@ -74,11 +82,12 @@ public function getImportMapData(array $entrypointNames): array
74
82
75
83
/**
76
84
* @internal
85
+ *
77
86
* @return array<string, array{path: string, type: string}>
78
87
*/
79
88
public function getRawImportMapData (): array
80
89
{
81
- $ dumpedImportMapPath = $ this ->assetsPathResolver ->getPublicFilesystemPath () . '/ ' . self ::IMPORT_MAP_CACHE_FILENAME ;
90
+ $ dumpedImportMapPath = $ this ->assetsPathResolver ->getPublicFilesystemPath (). '/ ' . self ::IMPORT_MAP_CACHE_FILENAME ;
82
91
if (is_file ($ dumpedImportMapPath )) {
83
92
return json_decode (file_get_contents ($ dumpedImportMapPath ), true , 512 , \JSON_THROW_ON_ERROR );
84
93
}
@@ -108,11 +117,12 @@ public function getRawImportMapData(): array
108
117
* Given an importmap entry name, finds all the non-lazy module imports in its chain.
109
118
*
110
119
* @internal
120
+ *
111
121
* @return array<string> The array of import names
112
122
*/
113
123
public function findEagerEntrypointImports (string $ entryName ): array
114
124
{
115
- $ dumpedEntrypointPath = $ this ->assetsPathResolver ->getPublicFilesystemPath () . '/ ' . sprintf (self ::ENTRYPOINT_CACHE_FILENAME_PATTERN , $ entryName );
125
+ $ dumpedEntrypointPath = $ this ->assetsPathResolver ->getPublicFilesystemPath (). '/ ' . sprintf (self ::ENTRYPOINT_CACHE_FILENAME_PATTERN , $ entryName );
116
126
if (is_file ($ dumpedEntrypointPath )) {
117
127
return json_decode (file_get_contents ($ dumpedEntrypointPath ), true , 512 , \JSON_THROW_ON_ERROR );
118
128
}
@@ -209,7 +219,7 @@ private function findAsset(string $path): ?MappedAsset
209
219
}
210
220
211
221
if (str_starts_with ($ path , '. ' )) {
212
- $ path = $ this ->importMapConfigReader ->getRootDirectory () . '/ ' . $ path ;
222
+ $ path = $ this ->importMapConfigReader ->getRootDirectory (). '/ ' . $ path ;
213
223
}
214
224
215
225
return $ this ->assetMapper ->getAssetFromSourcePath ($ path );
0 commit comments