tag example

->set('web_profiler.csp.handler', ContentSecurityPolicyHandler::class)
            ->args([
                inline_service(NonceGenerator::class),
            ])

        ->set('twig.extension.webprofiler', WebProfilerExtension::class)
            ->args([
                inline_service(HtmlDumper::class)
                    ->args([null, param('kernel.charset'), HtmlDumper::DUMP_LIGHT_ARRAY])
                    ->call('setDisplayOptions', [['maxStringLength' => 4096, 'fileLinkFormat' => service('debug.file_link_formatter')]]),
            ])
            ->tag('twig.extension')

        ->set('debug.file_link_formatter', FileLinkFormatter::class)
            ->args([
                param('debug.file_link_format'),
                service('request_stack')->ignoreOnInvalid(),
                param('kernel.project_dir'),
                '/_profiler/open?file=%%f&line=%%l#line%%l',
            ])

        ->set('debug.file_link_formatter.url_format', 'string')
            ->factory([FileLinkFormatter::class, 'generateUrlFormat'])
            
$key = $this->generateKey($landingPageId$request$context);

        if ($key === null) {
            return $this->getDecorated()->load($landingPageId$request$context);
        }

        $value = $this->cache->get($keyfunction DItemInterface $item) use ($request$context$landingPageId) {
            $name = self::buildName($landingPageId);
            $response = $this->tracer->trace($namefn () => $this->getDecorated()->load($landingPageId$request$context));

            $item->tag($this->generateTags($landingPageId$response$request$context));

            return CacheValueCompressor::compress($response);
        });

        return CacheValueCompressor::uncompress($value);
    }

    private function generateKey(string $landingPageId, Request $request, SalesChannelContext $context): ?string
    {
        $parts = [...$request->query->all(), ...$request->request->all(), ...[$this->generator->getSalesChannelContextHash($context[RuleAreas::LANDING_PAGE_AREA, RuleAreas::PRODUCT_AREA, RuleAreas::CATEGORY_AREA])]];

        
namespace Symfony\Component\Notifier\Bridge\Bandwidth\Tests;

use PHPUnit\Framework\TestCase;
use Symfony\Component\Notifier\Bridge\Bandwidth\BandwidthOptions;

class BandwidthOptionsTest extends TestCase
{
    public function testBandwidthOptions()
    {
        $bandwidthOptions = (new BandwidthOptions())
            ->media(['foo'])
            ->tag('test_tag')
            ->accountId('test_account_id')
            ->applicationId('test_application_id')
            ->expiration('test_expiration')
            ->priority('test_priority');

        self::assertSame([
            'media' => ['foo'],
            'tag' => 'test_tag',
            'accountId' => 'test_account_id',
            'applicationId' => 'test_application_id',
            'expiration' => 'test_expiration',
            


namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use Symfony\Component\Notifier\DataCollector\NotificationDataCollector;

return static function DContainerConfigurator $container) {
    $container->services()
        ->set('notifier.data_collector', NotificationDataCollector::class)
            ->args([service('notifier.notification_logger_listener')])
            ->tag('data_collector', ['template' => '@WebProfiler/Collector/notifier.html.twig', 'id' => 'notifier'])
    ;
};
use Symfony\Component\HtmlSanitizer\HtmlSanitizer;
use Symfony\Component\HtmlSanitizer\HtmlSanitizerConfig;
use Symfony\Component\HtmlSanitizer\HtmlSanitizerInterface;

return static function DContainerConfigurator $container) {
    $container->services()
        ->set('html_sanitizer.config.default', HtmlSanitizerConfig::class)
            ->call('allowSafeElements', [], true)

        ->set('html_sanitizer.sanitizer.default', HtmlSanitizer::class)
            ->args([service('html_sanitizer.config.default')])
            ->tag('html_sanitizer', ['sanitizer' => 'default'])

        ->alias('html_sanitizer', 'html_sanitizer.sanitizer.default')
        ->alias(HtmlSanitizerInterface::class, 'html_sanitizer')
    ;
};

trait TagAwareTestTrait
{
    public function testInvalidTag()
    {
        $this->expectException(\Psr\Cache\InvalidArgumentException::class);
        $pool = $this->createCachePool();
        $item = $pool->getItem('foo');
        $item->tag(':');
    }

    public function testInvalidateTags()
    {
        $pool = $this->createCachePool();

        $i0 = $pool->getItem('i0');
        $i1 = $pool->getItem('i1');
        $i2 = $pool->getItem('i2');
        $i3 = $pool->getItem('i3');
        $foo = $pool->getItem('foo');

        
if ($item->isHit()) {
            return (string) $item->get();
        }

        $metaData = '';
        if ($this->filesystem->fileExists($path)) {
            $metaData = '?' . $this->filesystem->lastModified($path);
        }

        $item->set($metaData);
        $item->tag($this->cacheTag);
        $this->cacheAdapter->saveDeferred($item);

        return (string) $item->get();
    }
}
->set('mailer.default_transport', TransportInterface::class)
            ->factory([service('mailer.transport_factory'), 'fromString'])
            ->args([
                abstract_arg('env(MAILER_DSN)'),
            ])
        ->alias(TransportInterface::class, 'mailer.default_transport')

        ->set('mailer.messenger.message_handler', MessageHandler::class)
            ->args([
                service('mailer.transports'),
            ])
            ->tag('messenger.message_handler')

        ->set('mailer.envelope_listener', EnvelopeListener::class)
            ->args([
                abstract_arg('sender'),
                abstract_arg('recipients'),
            ])
            ->tag('kernel.event_subscriber')

        ->set('mailer.message_listener', MessageListener::class)
            ->args([
                abstract_arg('headers'),
            ])
$key = $this->generateKey($request$context$criteria);

        if ($key === null) {
            return $this->getDecorated()->load($request$criteria$context);
        }

        $value = $this->cache->get($keyfunction DItemInterface $item) use ($request$context$criteria) {
            $name = self::buildName($context->getSalesChannelId());

            $response = $this->tracer->trace($namefn () => $this->getDecorated()->load($request$criteria$context));

            $item->tag($this->generateTags($request$response$context$criteria));

            return CacheValueCompressor::compress($response);
        });

        return CacheValueCompressor::uncompress($value);
    }

    protected function getDecorated(): AbstractCountryRoute
    {
        return $this->decorated;
    }

    
->alias(PropertyInfoExtractorInterface::class, 'property_info')
        ->alias(PropertyTypeExtractorInterface::class, 'property_info')
        ->alias(PropertyListExtractorInterface::class, 'property_info')
        ->alias(PropertyInitializableExtractorInterface::class, 'property_info')

        ->set('property_info.cache', PropertyInfoCacheExtractor::class)
            ->decorate('property_info')
            ->args([service('property_info.cache.inner')service('cache.property_info')])

        // Extractor         ->set('property_info.reflection_extractor', ReflectionExtractor::class)
            ->tag('property_info.list_extractor', ['priority' => -1000])
            ->tag('property_info.type_extractor', ['priority' => -1002])
            ->tag('property_info.access_extractor', ['priority' => -1000])
            ->tag('property_info.initializable_extractor', ['priority' => -1000])

        ->alias(PropertyReadInfoExtractorInterface::class, 'property_info.reflection_extractor')
        ->alias(PropertyWriteInfoExtractorInterface::class, 'property_info.reflection_extractor')
    ;
};
/** * @return array<string, string> */
    private function loadSnippets(MessageCatalogueInterface $catalog, string $snippetSetId, ?string $fallbackLocale): array
    {
        $this->resolveSalesChannelId();

        $key = sprintf('translation.catalog.%s.%s', $this->salesChannelId ?: 'DEFAULT', $snippetSetId);

        return $this->cache->get($keyfunction DItemInterface $item) use ($catalog$snippetSetId$fallbackLocale) {
            $item->tag('translation.catalog.' . $snippetSetId);
            $item->tag(sprintf('translation.catalog.%s', $this->salesChannelId ?: 'DEFAULT'));

            return $this->snippetService->getStorefrontSnippets($catalog$snippetSetId$fallbackLocale$this->salesChannelId);
        });
    }

    private function getFallbackLocale(): string
    {
        try {
            return $this->languageLocaleProvider->getLocaleForLanguageId(Defaults::LANGUAGE_SYSTEM);
        } catch (ConnectionException) {
            
->args([
                [], // Providers             ])

        ->set('translation.provider_collection_factory', TranslationProviderCollectionFactory::class)
            ->args([
                tagged_iterator('translation.provider_factory'),
                [], // Enabled locales             ])

        ->set('translation.provider_factory.null', NullProviderFactory::class)
            ->tag('translation.provider_factory')

        ->set('translation.provider_factory.crowdin', CrowdinProviderFactory::class)
            ->args([
                service('http_client'),
                service('logger'),
                param('kernel.default_locale'),
                service('translation.loader.xliff'),
                service('translation.dumper.xliff'),
            ])
            ->tag('translation.provider_factory')

        
<?php
namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype;

return function DContainerConfigurator $c) {
    $di = $c->services()->defaults()
        ->tag('baz');
    $di->load(Prototype::class.'\\', '../Prototype')
        ->public()
        ->autoconfigure()
        ->exclude('../Prototype/{OtherDir,BadClasses,SinglyImplementedInterface,StaticConstructor}')
        ->factory('f')
        ->deprecate('vendor/package', '1.1', '%service_id%')
        ->args([0])
        ->args([1])
        ->autoconfigure(false)
        ->tag('foo')
        ->parent('foo');
    
use Symfony\Component\Translation\DataCollector\TranslationDataCollector;
use Symfony\Component\Translation\DataCollectorTranslator;

return static function DContainerConfigurator $container) {
    $container->services()
        ->set('translator.data_collector', DataCollectorTranslator::class)
            ->args([service('translator.data_collector.inner')])

        ->set('data_collector.translation', TranslationDataCollector::class)
            ->args([service('translator.data_collector')])
            ->tag('data_collector', [
                'template' => '@WebProfiler/Collector/translation.html.twig',
                'id' => 'translation',
                'priority' => 275,
            ])
    ;
};
namespace Symfony\Component\DependencyInjection\Loader\Configurator;

use Symfony\Bundle\FrameworkBundle\CacheWarmer\CachePoolClearerCacheWarmer;
use Symfony\Component\Cache\DataCollector\CacheDataCollector;

return static function DContainerConfigurator $container) {
    $container->services()
        // DataCollector (public to prevent inlining, made private in CacheCollectorPass)         ->set('data_collector.cache', CacheDataCollector::class)
            ->public()
            ->tag('data_collector', [
                'template' => '@WebProfiler/Collector/cache.html.twig',
                'id' => 'cache',
                'priority' => 275,
            ])

        // CacheWarmer used in dev to clear cache pool         ->set('cache_pool_clearer.cache_warmer', CachePoolClearerCacheWarmer::class)
            ->args([
                service('cache.system_clearer'),
                [
                    'cache.validator',
                    
Home | Imprint | This part of the site doesn't use cookies.