File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Bundle/FrameworkBundle/Resources/config Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 7575 param ('kernel.project_dir ' ),
7676 abstract_arg ('array of excluded path patterns ' ),
7777 abstract_arg ('exclude dot files ' ),
78+ param ('kernel.debug ' ),
7879 ])
7980
8081 ->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(
3434 private readonly string $ projectRootDir ,
3535 private readonly array $ excludedPathPatterns = [],
3636 private readonly bool $ excludeDotFiles = true ,
37+ private readonly bool $ debug = false
3738 ) {
3839 }
3940
@@ -147,7 +148,7 @@ private function getDirectories(): array
147148 $ this ->absolutePaths = [];
148149 foreach ($ this ->paths as $ path => $ namespace ) {
149150 if ($ filesystem ->isAbsolutePath ($ path )) {
150- if (!file_exists ($ path )) {
151+ if (!file_exists ($ path ) && $ this -> debug ) {
151152 throw new \InvalidArgumentException (sprintf ('The asset mapper directory "%s" does not exist. ' , $ path ));
152153 }
153154 $ this ->absolutePaths [realpath ($ path )] = $ namespace ;
@@ -161,7 +162,9 @@ private function getDirectories(): array
161162 continue ;
162163 }
163164
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+ }
165168 }
166169
167170 return $ this ->absolutePaths ;
You can’t perform that action at this time.
0 commit comments