if (!
$container->
hasDefinition('events'
)) { return;
} $definition =
$container->
getDefinition('events'
);
foreach ($container->
findTaggedServiceIds('shopware.event_listener'
) as $id =>
$events) { $def =
$container->
getDefinition($id);
$def->
setPublic(true
);
if ($def->
isAbstract()) { throw new InvalidArgumentException(sprintf('The service "%s" must not be abstract as event listeners are lazy-loaded.',
$id));
} foreach ($events as $event) { $priority =
isset($event['priority'
]) ?
$event['priority'
] : 0;
if (!
isset($event['event'
])) { throw new InvalidArgumentException(sprintf('Service "%s" must define the "event" attribute on "%s" tags.',
$id, 'shopware.event_listener'
));
} if (!
isset($event['method'
])) { throw new InvalidArgumentException(sprintf('Service "%s" must define the "method" attribute on "%s" tags.',
$id, 'shopware.event_listener'
));
}