File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of the Symfony WebpackEncoreBundle package.
5
+ * (c) Fabien Potencier <[email protected] >
6
+ * For the full copyright and license information, please view the LICENSE
7
+ * file that was distributed with this source code.
8
+ */
9
+
10
+ namespace Symfony \WebpackEncoreBundle \Asset ;
11
+
12
+ use Symfony \WebpackEncoreBundle \Exception \UndefinedBuildException ;
13
+ use Psr \Container \ContainerInterface ;
14
+
15
+ /**
16
+ * Aggregate the different entry points configured in the container.
17
+ *
18
+ * Retrieve the EntrypointLookup instance from the given key.
19
+ *
20
+ * @final
21
+ */
22
+ class EntrypointLookupCollection
23
+ {
24
+ private $ buildEntrypoints ;
25
+
26
+ public function __construct (ContainerInterface $ buildEntrypoints )
27
+ {
28
+ $ this ->buildEntrypoints = $ buildEntrypoints ;
29
+ }
30
+
31
+ public function getEntrypointLookup (string $ buildName ): EntrypointLookupInterface
32
+ {
33
+ if (!$ this ->buildEntrypoints ->has ($ buildName )) {
34
+ throw new UndefinedBuildException (sprintf ('Given entry point "%s" is not configured ' , $ buildName ));
35
+ }
36
+
37
+ return $ this ->buildEntrypoints ->get ($ buildName );
38
+ }
39
+ }
You can’t perform that action at this time.
0 commit comments