Ver código fonte

Merge pull request #469 from webflo/remove-RepositoryPass

Remove dead compiler pass
Jordi Boggiano 10 anos atrás
pai
commit
17530758db

+ 0 - 45
src/Packagist/WebBundle/DependencyInjection/Compiler/RepositoryPass.php

@@ -1,45 +0,0 @@
-<?php
-
-/*
- * This file is part of Packagist.
- *
- * (c) Jordi Boggiano <j.boggiano@seld.be>
- *     Nils Adermann <naderman@naderman.de>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-namespace Packagist\WebBundle\DependencyInjection\Compiler;
-
-use Symfony\Component\DependencyInjection\Reference;
-use Symfony\Component\DependencyInjection\ContainerBuilder;
-use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
-
-/**
- * Adds VCS repository providers to the main repository_provider service
- *
- * @author Jordi Boggiano <j.boggiano@seld.be>
- */
-class RepositoryPass implements CompilerPassInterface
-{
-    public function process(ContainerBuilder $container)
-    {
-        if (!$container->hasDefinition('packagist.repository_provider')) {
-            return;
-        }
-
-        $provider = $container->getDefinition('packagist.repository_provider');
-        $providers = array();
-
-        foreach ($container->findTaggedServiceIds('packagist.repository_provider') as $id => $tags) {
-            $providers[$id] = isset($tags[0]['priority']) ? (int) $tags[0]['priority'] : 0;
-        }
-
-        arsort($providers);
-
-        foreach ($providers as $id => $priority) {
-            $provider->addMethodCall('addProvider', array(new Reference($id)));
-        }
-    }
-}

+ 0 - 6
src/Packagist/WebBundle/PackagistWebBundle.php

@@ -14,17 +14,11 @@ namespace Packagist\WebBundle;
 
 use Symfony\Component\HttpKernel\Bundle\Bundle;
 use Symfony\Component\DependencyInjection\ContainerBuilder;
-use Packagist\WebBundle\DependencyInjection\Compiler\RepositoryPass;
 
 /**
  * @author Jordi Boggiano <j.boggiano@seld.be>
  */
 class PackagistWebBundle extends Bundle
 {
-    public function build(ContainerBuilder $container)
-    {
-        parent::build($container);
 
-        $container->addCompilerPass(new RepositoryPass());
-    }
 }