Skip to content

Commit c84e6e7

Browse files
fre5hArtem Henvald
andauthored
Switch to php config (#7)
Co-authored-by: Artem Henvald <artem.genvald@stfalcon.com>
1 parent b267f4b commit c84e6e7

File tree

4 files changed

+30
-14
lines changed

4 files changed

+30
-14
lines changed

DependencyInjection/StfalconStudioDoctrineRedisCacheExtension.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
use Symfony\Component\Config\FileLocator;
1616
use Symfony\Component\DependencyInjection\ContainerBuilder;
17-
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
17+
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
1818
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
1919

2020
/**
@@ -33,7 +33,7 @@ public function load(array $configs, ContainerBuilder $container): void
3333
$config = $this->processConfiguration($configuration, $configs);
3434
$container->setParameter('doctrine_redis_cache.cache_pools', $config['cache_pools']);
3535

36-
$loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
37-
$loader->load('services.yaml');
36+
$loader = new PhpFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
37+
$loader->load('services.php');
3838
}
3939
}

Resources/config/services.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
/*
3+
* This file is part of the StfalconStudioDoctrineRedisCacheBundle.
4+
*
5+
* (c) Stfalcon LLC <stfalcon.com>
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
9+
*/
10+
11+
declare(strict_types=1);
12+
13+
use Doctrine\Migrations\Finder\MigrationFinder;
14+
use Doctrine\Migrations\Finder\RecursiveRegexFinder;
15+
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
16+
17+
return static function (ContainerConfigurator $containerConfigurator): void {
18+
$services = $containerConfigurator->services();
19+
20+
$services->defaults()
21+
->autowire()
22+
->autoconfigure();
23+
24+
$services->set(MigrationFinder::class, RecursiveRegexFinder::class);
25+
};

Resources/config/services.yaml

Lines changed: 0 additions & 8 deletions
This file was deleted.

composer.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,11 @@
2323
"symfony/config": "^6.1",
2424
"symfony/dependency-injection": "^6.1",
2525
"symfony/framework-bundle": "^6.1",
26-
"symfony/http-kernel": "^6.1",
27-
"symfony/yaml": "^6.1"
26+
"symfony/http-kernel": "^6.1"
2827
},
2928
"require-dev": {
3029
"escapestudios/symfony2-coding-standard": "^3.12",
31-
"phpstan/phpstan": "^1.7.10",
30+
"phpstan/phpstan": "^1.8.2",
3231
"phpstan/phpstan-doctrine": "^1.3",
3332
"phpstan/phpstan-phpunit": "^1.1",
3433
"phpstan/phpstan-symfony": "^1.2",

0 commit comments

Comments
 (0)