Skip to content

Commit bdea763

Browse files
#148 Update directory structure according to Symfony best practices
1 parent 49c24c2 commit bdea763

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+9
-9
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.

docs/index.md

src/CleverAgeProcessBundle.php

+7-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use CleverAge\ProcessBundle\DependencyInjection\Compiler\CheckSerializerCompilerPass;
1717
use CleverAge\ProcessBundle\DependencyInjection\Compiler\RegistryCompilerPass;
1818
use CleverAge\ProcessBundle\Registry\TransformerRegistry;
19-
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
2019
use Symfony\Component\DependencyInjection\ContainerBuilder;
2120
use Symfony\Component\HttpKernel\Bundle\Bundle;
2221

@@ -30,11 +29,14 @@ public function build(ContainerBuilder $container): void
3029
parent::build($container);
3130

3231
$container->addCompilerPass(
33-
new RegistryCompilerPass(TransformerRegistry::class, 'cleverage.transformer', 'addTransformer'),
34-
PassConfig::TYPE_BEFORE_OPTIMIZATION,
35-
0
32+
new RegistryCompilerPass(TransformerRegistry::class, 'cleverage.transformer', 'addTransformer')
3633
);
3734

38-
$container->addCompilerPass(new CheckSerializerCompilerPass(), PassConfig::TYPE_BEFORE_OPTIMIZATION, 0);
35+
$container->addCompilerPass(new CheckSerializerCompilerPass());
36+
}
37+
38+
public function getPath(): string
39+
{
40+
return \dirname(__DIR__);
3941
}
4042
}

src/DependencyInjection/CleverAgeProcessExtension.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,14 @@
2525
/**
2626
* This is the class that loads and manages your bundle configuration.
2727
*
28-
* @see http://symfony.com/doc/current/cookbook/bundles/extension.html
28+
* @see https://symfony.com/doc/current/bundles/extension.html
2929
*/
3030
class CleverAgeProcessExtension extends Extension
3131
{
3232
public function load(array $configs, ContainerBuilder $container): void
3333
{
3434
// Get the path of the service folder wherever the bundle is installed
35-
$reflection = new \ReflectionClass($this);
36-
$serviceFolderPath = \dirname($reflection->getFileName(), 2).'/Resources/config/services';
37-
$this->findServices($container, $serviceFolderPath);
35+
$this->findServices($container, __DIR__.'/../../config/services');
3836

3937
$configuration = new Configuration();
4038
$config = $this->processConfiguration($configuration, $configs);

0 commit comments

Comments
 (0)