Browse Source

Remove ConfigAwareInterface

Dariusz Ruminski 9 years ago
parent
commit
bd02a1cc8a

+ 0 - 26
src/ConfigAwareInterface.php

@@ -1,26 +0,0 @@
-<?php
-
-/*
- * This file is part of PHP CS Fixer.
- *
- * (c) Fabien Potencier <fabien@symfony.com>
- *     Dariusz Rumiński <dariusz.ruminski@gmail.com>
- *
- * This source file is subject to the MIT license that is bundled
- * with this source code in the file LICENSE.
- */
-
-namespace PhpCsFixer;
-
-/**
- * @author Jordi Boggiano <j.boggiano@seld.be>
- */
-interface ConfigAwareInterface
-{
-    /**
-     * Sets the active config on the fixer.
-     *
-     * @param ConfigInterface $config
-     */
-    public function setConfig(ConfigInterface $config);
-}

+ 0 - 1
src/Console/ConfigurationResolver.php

@@ -214,7 +214,6 @@ final class ConfigurationResolver
         $this->resolveRiskyAllowed();
 
         $this->fixerFactory->registerCustomFixers($this->getConfig()->getCustomFixers());
-        $this->fixerFactory->attachConfig($this->getConfig());
 
         $this->resolveRules();
         $this->resolveFixers();

+ 0 - 18
src/FixerFactory.php

@@ -53,24 +53,6 @@ final class FixerFactory
         return new self();
     }
 
-    /**
-     * Attach config into all fixers that are aware of it.
-     *
-     * @param ConfigInterface $config
-     *
-     * @return $this
-     */
-    public function attachConfig(ConfigInterface $config)
-    {
-        foreach ($this->fixers as $fixer) {
-            if ($fixer instanceof ConfigAwareInterface) {
-                $fixer->setConfig($config);
-            }
-        }
-
-        return $this;
-    }
-
     /**
      * Get fixers.
      *

+ 0 - 4
tests/FixerFactoryTest.php

@@ -42,10 +42,6 @@ final class FixerFactoryTest extends \PHPUnit_Framework_TestCase
         $mock->expects($this->any())->method('getRules')->willReturn(array());
         $testInstance = $factory->useRuleSet($mock);
         $this->assertSame($factory, $testInstance);
-
-        $mock = $this->getMock('PhpCsFixer\ConfigInterface');
-        $testInstance = $factory->attachConfig($mock);
-        $this->assertSame($factory, $testInstance);
     }
 
     /**