Skip to content

Commit

Permalink
Add .castor.stub.php to ecs.php
Browse files Browse the repository at this point in the history
This commit includes '.castor.stub.php' in ecs.php. This is part of a series of changes geared towards improving our code distribution environment.
  • Loading branch information
Spomky committed Apr 12, 2024
1 parent 87f2e6d commit 69468b5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 47 deletions.
39 changes: 0 additions & 39 deletions src/DependencyInjection/SpomkyLabsCborExtension.php

This file was deleted.

7 changes: 7 additions & 0 deletions src/Resources/config/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
declare(strict_types=1);

use CBOR\Decoder;
use CBOR\OtherObject\OtherObjectInterface;
use CBOR\OtherObject\OtherObjectManager;
use CBOR\Tag\TagInterface;
use CBOR\Tag\TagManager;
use SpomkyLabs\CborBundle\CBORDecoder;
use SpomkyLabs\CborBundle\DependencyInjection\Compiler\OtherObjectCompilerPass;
use SpomkyLabs\CborBundle\DependencyInjection\Compiler\TagCompilerPass;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

return static function (ContainerConfigurator $container): void {
Expand All @@ -20,4 +24,7 @@
$container->set(CBORDecoder::class)->public();
$container->set(OtherObjectManager::class);
$container->set(TagManager::class);

$container->instanceof(TagInterface::class)->tag(TagCompilerPass::TAG);
$container->instanceof(OtherObjectInterface::class)->tag(OtherObjectCompilerPass::TAG);
};
17 changes: 9 additions & 8 deletions src/SpomkyLabsCborBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,22 @@

use SpomkyLabs\CborBundle\DependencyInjection\Compiler\OtherObjectCompilerPass;
use SpomkyLabs\CborBundle\DependencyInjection\Compiler\TagCompilerPass;
use SpomkyLabs\CborBundle\DependencyInjection\SpomkyLabsCborExtension;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symfony\Component\HttpKernel\Bundle\AbstractBundle;

final class SpomkyLabsCborBundle extends Bundle
final class SpomkyLabsCborBundle extends AbstractBundle
{
public function getContainerExtension(): SpomkyLabsCborExtension
{
return new SpomkyLabsCborExtension();
}
protected string $extensionAlias = 'cbor';

public function build(ContainerBuilder $container): void
{
parent::build($container);
$container->addCompilerPass(new TagCompilerPass());
$container->addCompilerPass(new OtherObjectCompilerPass());
}

public function loadExtension(array $config, ContainerConfigurator $container, ContainerBuilder $builder): void
{
$container->import('Resources/config/services.php');
}
}

0 comments on commit 69468b5

Please sign in to comment.