-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhelpers.php
More file actions
53 lines (47 loc) · 1.38 KB
/
helpers.php
File metadata and controls
53 lines (47 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
// Compability with Symfony 4.x
use Symfony\Component\DependencyInjection\Argument\AbstractArgument;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Loader\Configurator\EnvConfigurator;
use Symfony\Component\DependencyInjection\Loader\Configurator\InlineServiceConfigurator;
use Symfony\Component\DependencyInjection\Loader\Configurator\ReferenceConfigurator;
if (!function_exists('service')) {
/**
* Creates a reference to a service.
*
* @param string $serviceId Service ID.
*
* @return ReferenceConfigurator
*/
function service(string $serviceId): ReferenceConfigurator
{
return new ReferenceConfigurator($serviceId);
}
}
if (!function_exists('inline_service')) {
/**
* Creates an inline service.
*/
function inline_service(string $class = null): InlineServiceConfigurator
{
return new InlineServiceConfigurator(new Definition($class));
}
}
if (!function_exists('abstract_arg')) {
/**
* Creates an abstract argument.
*/
function abstract_arg(string $description): AbstractArgument
{
return new AbstractArgument($description);
}
}
if (!function_exists('env')) {
/**
* Creates an environment variable reference.
*/
function env(string $name): EnvConfigurator
{
return new EnvConfigurator($name);
}
}