first commit

This commit is contained in:
2025-08-02 16:30:27 +02:00
commit 23646bfcee
14851 changed files with 1750626 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
<?php
namespace KupShop\FeedGeneratorBundle\DependencyInjection\Compiler;
use KupShop\FeedGeneratorBundle\ContextPropertiesLocator;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
/**
* Check out https://symfony.com/doc/current/service_container/tags.html.
*/
class ContextPropertiesPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container)
{
// always first check if the primary service is defined
if (!$container->has(ContextPropertiesLocator::class)) {
return;
}
$definition = $container->findDefinition(ContextPropertiesLocator::class);
// find all service IDs with the kupshop.feed.expression.functions tag
$taggedServices = $container->findTaggedServiceIds('kupshop.feed.context.property');
foreach ($taggedServices as $id => $tags) {
$class = $container->findDefinition($id)->getClass();
$definition->addMethodCall('addContextProperty', [
$id,
$class::getName(),
]);
}
$definition->addMethodCall('sortContexts');
}
}