File tree Expand file tree Collapse file tree 2 files changed +54
-1
lines changed Expand file tree Collapse file tree 2 files changed +54
-1
lines changed Original file line number Diff line number Diff line change 1414 }
1515 ],
1616 "autoload" : {
17- "psr-4" : {"ProklUng\\ ContainerBoilerplate\\ " : " src" }
17+ "psr-4" : {"ProklUng\\ ContainerBoilerplate\\ " : " src" },
18+ "files" : [" functions/helpers.php" ]
1819 },
1920 "autoload-dev" : {
2021 "psr-4" : {"ProklUng\\ ContainerBoilerplate\\ Tests\\ " : " tests" }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ // Compability with Symfony 4.x
4+ use Symfony \Component \DependencyInjection \Argument \AbstractArgument ;
5+ use Symfony \Component \DependencyInjection \Definition ;
6+ use Symfony \Component \DependencyInjection \Loader \Configurator \EnvConfigurator ;
7+ use Symfony \Component \DependencyInjection \Loader \Configurator \InlineServiceConfigurator ;
8+ use Symfony \Component \DependencyInjection \Loader \Configurator \ReferenceConfigurator ;
9+
10+ if (!function_exists ('service ' )) {
11+ /**
12+ * Creates a reference to a service.
13+ *
14+ * @param string $serviceId Service ID.
15+ *
16+ * @return ReferenceConfigurator
17+ */
18+ function service (string $ serviceId ): ReferenceConfigurator
19+ {
20+ return new ReferenceConfigurator ($ serviceId );
21+ }
22+ }
23+
24+ if (!function_exists ('inline_service ' )) {
25+ /**
26+ * Creates an inline service.
27+ */
28+ function inline_service (string $ class = null ): InlineServiceConfigurator
29+ {
30+ return new InlineServiceConfigurator (new Definition ($ class ));
31+ }
32+ }
33+
34+ if (!function_exists ('abstract_arg ' )) {
35+ /**
36+ * Creates an abstract argument.
37+ */
38+ function abstract_arg (string $ description ): AbstractArgument
39+ {
40+ return new AbstractArgument ($ description );
41+ }
42+ }
43+
44+ if (!function_exists ('env ' )) {
45+ /**
46+ * Creates an environment variable reference.
47+ */
48+ function env (string $ name ): EnvConfigurator
49+ {
50+ return new EnvConfigurator ($ name );
51+ }
52+ }
You can’t perform that action at this time.
0 commit comments