Skip to content

Commit 4c151fa

Browse files
#4 Remove sidus/base-bundle dependency
1 parent c9bc1c4 commit 4c151fa

File tree

4 files changed

+27
-9
lines changed

4 files changed

+27
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ v2.0
1010

1111
* [#3](https://github.com/cleverage/flysystem-process-bundle/issues/3) Add Makefile & .docker for local standalone usage
1212
* [#3](https://github.com/cleverage/flysystem-process-bundle/issues/3) Add rector, phpstan & php-cs-fixer configurations & apply it
13+
* [#4](https://github.com/cleverage/flysystem-process-bundle/issues/4) Remove `sidus/base-bundle` dependency
1314

1415
### Fixes
1516

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@
4545
"require": {
4646
"php": ">=8.1",
4747
"cleverage/process-bundle": "dev-prepare-release",
48-
"league/flysystem-bundle": "^3.0",
49-
"sidus/base-bundle": "~1.0"
48+
"league/flysystem-bundle": "^3.0"
5049
},
5150
"require-dev": {
5251
"friendsofphp/php-cs-fixer": "*",

src/DependencyInjection/CleverAgeFlysystemProcessExtension.php

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,35 @@
1313

1414
namespace CleverAge\FlysystemProcessBundle\DependencyInjection;
1515

16-
use Sidus\BaseBundle\DependencyInjection\SidusBaseExtension;
16+
use Symfony\Component\Config\FileLocator;
17+
use Symfony\Component\DependencyInjection\ContainerBuilder;
18+
use Symfony\Component\DependencyInjection\Extension\Extension;
19+
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
20+
use Symfony\Component\Finder\Finder;
1721

1822
/**
1923
* This is the class that loads and manages your bundle configuration.
2024
*
21-
* @see http://symfony.com/doc/current/cookbook/bundles/extension.html
22-
*
23-
* @author Valentin Clavreul <[email protected]>
24-
* @author Vincent Chalnot <[email protected]>
25-
* @author Madeline Veyrenc <[email protected]>
25+
* @see http://symfony.com/doc/current/cookbook/bundles/extension.html
2626
*/
27-
class CleverAgeFlysystemProcessExtension extends SidusBaseExtension
27+
class CleverAgeFlysystemProcessExtension extends Extension
2828
{
29+
public function load(array $configs, ContainerBuilder $container): void
30+
{
31+
$this->findServices($container, __DIR__.'/../Resources/config/services');
32+
}
33+
34+
/**
35+
* Recursively import config files into container.
36+
*/
37+
protected function findServices(ContainerBuilder $container, string $path, string $extension = 'yaml'): void
38+
{
39+
$finder = new Finder();
40+
$finder->in($path)
41+
->name('*.'.$extension)->files();
42+
$loader = new YamlFileLoader($container, new FileLocator($path));
43+
foreach ($finder as $file) {
44+
$loader->load($file->getFilename());
45+
}
46+
}
2947
}
File renamed without changes.

0 commit comments

Comments
 (0)