File tree 2 files changed +6
-2
lines changed
Bundle/FrameworkBundle/Resources/config
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 75
75
param ('kernel.project_dir ' ),
76
76
abstract_arg ('array of excluded path patterns ' ),
77
77
abstract_arg ('exclude dot files ' ),
78
+ param ('kernel.debug ' ),
78
79
])
79
80
80
81
->set ('asset_mapper.public_assets_path_resolver ' , PublicAssetsPathResolver::class)
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ public function __construct(
34
34
private readonly string $ projectRootDir ,
35
35
private readonly array $ excludedPathPatterns = [],
36
36
private readonly bool $ excludeDotFiles = true ,
37
+ private readonly bool $ debug = false
37
38
) {
38
39
}
39
40
@@ -147,7 +148,7 @@ private function getDirectories(): array
147
148
$ this ->absolutePaths = [];
148
149
foreach ($ this ->paths as $ path => $ namespace ) {
149
150
if ($ filesystem ->isAbsolutePath ($ path )) {
150
- if (!file_exists ($ path )) {
151
+ if (!file_exists ($ path ) && $ this -> debug ) {
151
152
throw new \InvalidArgumentException (sprintf ('The asset mapper directory "%s" does not exist. ' , $ path ));
152
153
}
153
154
$ this ->absolutePaths [realpath ($ path )] = $ namespace ;
@@ -161,7 +162,9 @@ private function getDirectories(): array
161
162
continue ;
162
163
}
163
164
164
- throw new \InvalidArgumentException (sprintf ('The asset mapper directory "%s" does not exist. ' , $ path ));
165
+ if ($ this ->debug ) {
166
+ throw new \InvalidArgumentException (sprintf ('The asset mapper directory "%s" does not exist. ' , $ path ));
167
+ }
165
168
}
166
169
167
170
return $ this ->absolutePaths ;
You can’t perform that action at this time.
0 commit comments