Skip to content

Commit

Permalink
Refactoring: yaml to php di, fix directory struct
Browse files Browse the repository at this point in the history
  • Loading branch information
grachevko committed Jun 28, 2021
1 parent 1f2a80f commit 819f2c9
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/DependencyInjection/NsqExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class NsqExtension extends Extension
*/
public function load(array $configs, ContainerBuilder $container): void
{
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.yml');
$loader = new Loader\PhpFileLoader($container, new FileLocator(__DIR__.'/../config'));
$loader->load('services.php');
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php
declare(strict_types=1);

namespace Nsq\NsqBundle\Messenger;
namespace Nsq\NsqBundle\EventListener;

use Nsq\NsqBundle\Messenger\NsqReceivedStamp;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Messenger\Event\WorkerMessageFailedEvent;
use function Amp\Promise\wait;
Expand Down
9 changes: 0 additions & 9 deletions src/Resources/config/services.yml

This file was deleted.

18 changes: 18 additions & 0 deletions src/config/services.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types=1);

use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

return static function (ContainerConfigurator $configurator): void {
$services = $configurator->services();

$services->set(Nsq\NsqBundle\Messenger\NsqTransportFactory::class)
->tag('messenger.transport_factory')
->tag('container.no_preload')
;

$services->set(\Nsq\NsqBundle\EventListener\AckUnrecoverableMessageListener::class)
->tag('kernel.event_subscriber')
;
};

0 comments on commit 819f2c9

Please sign in to comment.