Skip to content

Instantly share code, notes, and snippets.

@docteurklein
docteurklein / CompilerPass.php
Last active October 17, 2017 11:39
Service Repository Factory
<?php
public function process(ContainerBuilder $container)
{
$factory = $container->findDefinition('app.doctrine.repository.factory');
$repositories = [];
foreach ($container->findTaggedServiceIds('app.repository') as $id => $params) {
foreach ($params as $param) {
$repositories[$param['class']] = $id;
@snc
snc / InteractiveLoginListener.php
Created October 25, 2011 13:44
Custom FOSUB redirects
<?php
namespace My\Bundle\EventListener;
use My\Bundle\User\User;
use Symfony\Component\Routing\Router;
use Symfony\Component\Security\Http\Event\InteractiveLoginEvent;
class InteractiveLoginListener
{