Skip to content

Instantly share code, notes, and snippets.

@kurozumi
Last active December 8, 2020 01:45
Show Gist options
  • Save kurozumi/14baae5c211c3fbcb50410af2613e477 to your computer and use it in GitHub Desktop.
Save kurozumi/14baae5c211c3fbcb50410af2613e477 to your computer and use it in GitHub Desktop.
会員タイプのインターフェースが実装されたクラスに自動タグ付け
<?php
/**
* This file is part of CustomerType
*
* Copyright(c) Akira Kurozumi <info@a-zumi.net>
*
* https://a-zumi.net
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Plugin\CustomerType\DependencyInjection;
use Plugin\CustomerType\Service\Customer\CustomerTypeInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\Extension;
class CustomerTypeExtension extends Extension
{
/**
* 会員タイプのStrategyインターフェースが実装されたクラスにeccube.customer.typeをタグ付け
*
* @param array $configs
* @param ContainerBuilder $container
*/
public function load(array $configs, ContainerBuilder $container)
{
$container->registerForAutoconfiguration(CustomerTypeInterface::class)
->addTag(CustomerTypeCompilerPass::CUSTOMR_TYPE_TAG);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment