Skip to content

Commit

Permalink
Improvements and namespace ownerschip
Browse files Browse the repository at this point in the history
  • Loading branch information
gertvdb committed Feb 4, 2021
1 parent e2264a0 commit 0d01ef2
Show file tree
Hide file tree
Showing 17 changed files with 89 additions and 34 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"symplify/phpstan-extensions": "^9.0",
"symplify/phpstan-php-config": "^9.0",
"rector/rector": "^0.9.18",
"phpunit/phpunit": "^9.5"
"phpunit/phpunit": "^9.5",
"symplify/config-transformer": "^9.0"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 2 additions & 0 deletions src/Autoload/LegacyClassLoaderInterface.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace gertvdb\LegacyBridgeBundle\Autoload;

use gertvdb\LegacyBridgeBundle\Kernel\LegacyKernelInterface;
Expand Down
20 changes: 20 additions & 0 deletions src/Configuration/Option.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

declare(strict_types=1);

namespace gertvdb\LegacyBridgeBundle\Configuration;

final class Option
{

/**
* @var string
*/
public const OPTION_ROUTE_LISTENER_CLASS = 'legacy_bridge_bundle.router_listener.class';

/**
* @var string
*/
public const OPTION_BOOTER_LISTENER_CLASS = 'legacy_bridge_bundle.legacy_booter_listener.class';

}
2 changes: 2 additions & 0 deletions src/DependencyInjection/Compiler/KernelConfigurationPass.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace gertvdb\LegacyBridgeBundle\DependencyInjection\Compiler;

use Exception;
Expand Down
2 changes: 2 additions & 0 deletions src/DependencyInjection/Compiler/LoaderInjectorPass.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace gertvdb\LegacyBridgeBundle\DependencyInjection\Compiler;

use Composer\Autoload\ClassLoader;
Expand Down
2 changes: 2 additions & 0 deletions src/DependencyInjection/Compiler/ReplaceRouterPass.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace gertvdb\LegacyBridgeBundle\DependencyInjection\Compiler;

use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
Expand Down
2 changes: 2 additions & 0 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace gertvdb\LegacyBridgeBundle\DependencyInjection;

use Symfony\Component\Config\Definition\Builder\TreeBuilder;
Expand Down
2 changes: 2 additions & 0 deletions src/DependencyInjection/LegacyBridgeBundleExtension.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace gertvdb\LegacyBridgeBundle\DependencyInjection;

use Symfony\Component\DependencyInjection\ContainerBuilder;
Expand Down
2 changes: 2 additions & 0 deletions src/Event/LegacyKernelBootEvent.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace gertvdb\LegacyBridgeBundle\Event;

use Symfony\Component\HttpFoundation\Request;
Expand Down
2 changes: 2 additions & 0 deletions src/Event/LegacyKernelBootEventInterface.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace gertvdb\LegacyBridgeBundle\Event;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/EventListener/LegacyBooterListener.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace gertvdb\LegacyBridgeBundle\EventListener;

use Symfony\Component\DependencyInjection\ContainerInterface;
Expand Down
2 changes: 2 additions & 0 deletions src/EventListener/RouterListener.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace gertvdb\LegacyBridgeBundle\EventListener;

use Exception;
Expand Down
2 changes: 2 additions & 0 deletions src/Kernel/LegacyKernel.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace gertvdb\LegacyBridgeBundle\Kernel;

use gertvdb\LegacyBridgeBundle\Autoload\LegacyClassLoaderInterface;
Expand Down
2 changes: 2 additions & 0 deletions src/Kernel/LegacyKernelInterface.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace gertvdb\LegacyBridgeBundle\Kernel;

use RuntimeException;
Expand Down
3 changes: 3 additions & 0 deletions src/LegacyBridgeBundle.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?php

declare(strict_types=1);

/**
* Bridge bundle for legacy projects
*/
Expand Down
40 changes: 40 additions & 0 deletions src/Resources/config/services.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

declare(strict_types=1);

use gertvdb\LegacyBridgeBundle\Configuration\Option;
use gertvdb\LegacyBridgeBundle\EventListener\LegacyBooterListener;
use gertvdb\LegacyBridgeBundle\EventListener\RouterListener;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use function Symfony\Component\DependencyInjection\Loader\Configurator\service;

/**
* Container configurator
* @param ContainerConfigurator $containerConfigurator
*/
return static function (ContainerConfigurator $containerConfigurator): void {
$parameters = $containerConfigurator->parameters();

$parameters->set(Option::OPTION_ROUTE_LISTENER_CLASS, RouterListener::class);
$parameters->set(Option::OPTION_BOOTER_LISTENER_CLASS, LegacyBooterListener::class);

$services = $containerConfigurator->services();

$services->set('legacy_bridge_bundle.router_listener', '%legacy_bridge_bundle.router_listener.class%')
->tag('kernel.event_subscriber', [])
->tag('monolog.logger', ['channel' => 'event'])
->autowire()
->args([
service('router_listener'),
service('legacy_bridge_bundle.legacy_kernel'),
service('?logger')
]);

$services->set('legacy_bridge_bundle.legacy_booter_listener', '%legacy_bridge_bundle.legacy_booter_listener.class%')
->tag('kernel.event_subscriber', [])
->autowire()
->args([
service('legacy_bridge_bundle.legacy_kernel'),
service('service_container')
]);
};
33 changes: 0 additions & 33 deletions src/Resources/config/services.xml

This file was deleted.

0 comments on commit 0d01ef2

Please sign in to comment.