-
Notifications
You must be signed in to change notification settings - Fork 8
/
services.php
52 lines (41 loc) · 2.44 KB
/
services.php
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
// This file is the entry point to configure your own services.
// Files in the packages/ subdirectory configure your dependencies.
// Put parameters here that don't need to change on each machine where the app is deployed
// @see https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration
// The PHP configuration files have been generated with symplify/config-transformer.
// @see https://github.com/symplify/config-transformer
declare(strict_types=1);
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symfony\Component\HttpKernel\Kernel;
return static function (ContainerConfigurator $containerConfigurator): void {
$parameters = $containerConfigurator->parameters();
// System parameters: https://symfony.com/doc/current/performance.html#dump-the-service-container-into-a-single-file
$parameters->set('.container.dumper.inline_factories', true);
// Application parameters ——————————————————————————————————————————————————
$parameters->set('brand', 'MicroSymfony');
$parameters->set('brand_html', '<b>Micro</b>Symfony 🎶');
$parameters->set('brand_emoji', '🎶️');
$parameters->set('website', 'https://github.com/strangebuzz/MicroSymfony');
$parameters->set('version', '1.0.0');
$sfVersion = substr(Kernel::VERSION, 0, 3); // minor Symfony version
$description = <<<DESCRIPTION
A Symfony <b>$sfVersion</b> application template on steroids, ready to use.
DESCRIPTION;
$parameters->set('description', $description);
// Services ————————————————————————————————————————————————————————————————
$services = $containerConfigurator->services();
$services->defaults()
->autowire() // Automatically injects dependencies in your services.
->autoconfigure() // Automatically registers your services as commands, event subscribers, etc.
// bind examples
->bind('string $environment', '%kernel.environment%')
->bind('bool $debug', '%kernel.debug%')
;
$services->load('App\\', __DIR__.'/../src')
->exclude([
__DIR__.'/../src/DependencyInjection/',
__DIR__.'/../src/Entity/',
__DIR__.'/../src/Kernel.php',
]);
};