Skip to content

Commit

Permalink
minor #12837 [2.3] CS Fixes And Removed Unused Imports (GrahamCampbell)
Browse files Browse the repository at this point in the history
This PR was merged into the 2.3 branch.

Discussion
----------

[2.3] CS Fixes And Removed Unused Imports

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | N/A
| License       | MIT
| Doc PR        | N/A

##### This pull request fixes some cs issues in symfony 2.3.

As far as I understand, symfony's coding standards dictate that there should be no blank lines between imports and imports should not be prefixed with a slash. There are one or two other tiny fixes in here too.

Also, we should only import things that we actually *use*. :)

Commits
-------

0e4f0e7 Removed unused imports
0fc3369 CS fixes
  • Loading branch information
fabpot committed Dec 3, 2014
2 parents 9b24d18 + 0e4f0e7 commit cef9972
Show file tree
Hide file tree
Showing 43 changed files with 11 additions and 57 deletions.
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Bridge\Doctrine\DependencyInjection\Security\UserProvider;

use Symfony\Component\Config\Definition\Builder\NodeDefinition;

use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\UserProvider\UserProviderFactoryInterface;
use Symfony\Component\DependencyInjection\DefinitionDecorator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
Expand Down
Expand Up @@ -11,9 +11,9 @@

namespace Symfony\Bridge\Propel1\Form\ChoiceList;

use \ModelCriteria;
use \BaseObject;
use \Persistent;
use ModelCriteria;
use BaseObject;
use Persistent;
use Symfony\Component\Form\Exception\StringCastException;
use Symfony\Component\Form\Extension\Core\ChoiceList\ObjectChoiceList;
use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException;
Expand Down
Expand Up @@ -11,7 +11,7 @@

namespace Symfony\Bridge\Propel1\Form\DataTransformer;

use \PropelObjectCollection;
use PropelObjectCollection;
use Symfony\Component\Form\DataTransformerInterface;
use Symfony\Component\Form\Exception\TransformationFailedException;

Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bridge/Propel1/Tests/Fixtures/Item.php
Expand Up @@ -11,7 +11,7 @@

namespace Symfony\Bridge\Propel1\Tests\Fixtures;

use \PropelPDO;
use PropelPDO;

class Item implements \Persistent
{
Expand Down
Expand Up @@ -11,7 +11,7 @@

namespace Symfony\Bridge\Propel1\Tests\Form\DataTransformer;

use \PropelObjectCollection;
use PropelObjectCollection;
use Symfony\Bridge\Propel1\Form\DataTransformer\CollectionToArrayTransformer;
use Symfony\Bridge\Propel1\Tests\Propel1TestCase;

Expand Down
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Bundle\FrameworkBundle\EventListener;

use Symfony\Component\DependencyInjection\ContainerInterface;

use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;
Expand Down
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Bundle\SecurityBundle\DependencyInjection;

use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory;

use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
use Symfony\Component\Config\Definition\ConfigurationInterface;
Expand Down
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory;

use Symfony\Component\Config\Definition\Builder\NodeDefinition;

use Symfony\Component\DependencyInjection\DefinitionDecorator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
Expand Down
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory;

use Symfony\Component\Config\Definition\Builder\NodeDefinition;

use Symfony\Component\DependencyInjection\DefinitionDecorator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
Expand Down
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory;

use Symfony\Component\Config\Definition\Builder\NodeDefinition;

use Symfony\Component\DependencyInjection\DefinitionDecorator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
Expand Down
Expand Up @@ -12,9 +12,7 @@
namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory;

use Symfony\Component\Config\Definition\Builder\NodeDefinition;

use Symfony\Component\DependencyInjection\DefinitionDecorator;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;

Expand Down
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Security\UserProvider;

use Symfony\Component\Config\Definition\Builder\NodeDefinition;

use Symfony\Component\DependencyInjection\DefinitionDecorator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
Expand Down
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\FormLoginBundle\DependencyInjection;

use Symfony\Component\DependencyInjection\Reference;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;

Expand Down
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Bundle\WebProfilerBundle\Tests\DependencyInjection;

use Symfony\Bundle\WebProfilerBundle\Tests\TestCase;

use Symfony\Bundle\WebProfilerBundle\DependencyInjection\WebProfilerExtension;
use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\DependencyInjection\ContainerBuilder;
Expand Down
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\DependencyInjection\Compiler;

use Symfony\Component\DependencyInjection\Definition;

use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\Reference;
Expand Down
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\DependencyInjection\Tests\Compiler;

use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Compiler\Compiler;
use Symfony\Component\DependencyInjection\Compiler\AnalyzeServiceReferencesPass;
use Symfony\Component\DependencyInjection\Compiler\RepeatedPass;
use Symfony\Component\DependencyInjection\Reference;
Expand Down
Expand Up @@ -12,13 +12,9 @@
namespace Symfony\Component\DependencyInjection\Tests\Compiler;

use Symfony\Component\DependencyInjection\Reference;

use Symfony\Component\DependencyInjection\Compiler\CheckCircularReferencesPass;

use Symfony\Component\DependencyInjection\Compiler\AnalyzeServiceReferencesPass;

use Symfony\Component\DependencyInjection\Compiler\Compiler;

use Symfony\Component\DependencyInjection\ContainerBuilder;

class CheckCircularReferencesPassTest extends \PHPUnit_Framework_TestCase
Expand Down
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\DependencyInjection\Tests\Compiler;

use Symfony\Component\DependencyInjection\Definition;

use Symfony\Component\DependencyInjection\Compiler\CheckExceptionOnInvalidReferenceBehaviorPass;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\ContainerBuilder;
Expand Down
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\DependencyInjection\Tests\Compiler;

use Symfony\Component\DependencyInjection\Scope;

use Symfony\Component\DependencyInjection\Compiler\CheckReferenceValidityPass;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\Reference;
Expand Down
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\DependencyInjection\Tests\Compiler;

use Symfony\Component\DependencyInjection\Compiler\AnalyzeServiceReferencesPass;
use Symfony\Component\DependencyInjection\Compiler\Compiler;
use Symfony\Component\DependencyInjection\Compiler\RepeatedPass;
use Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass;
use Symfony\Component\DependencyInjection\Definition;
Expand Down
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\DependencyInjection\Tests\Loader;

use Symfony\Component\DependencyInjection\ContainerInterface;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\Definition;
Expand Down
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\Form\Extension\Core\DataTransformer;

use Symfony\Component\Form\Exception\TransformationFailedException;

use Symfony\Component\Form\DataTransformerInterface;
use Symfony\Component\Form\Extension\Core\ChoiceList\ChoiceListInterface;

Expand Down
3 changes: 1 addition & 2 deletions src/Symfony/Component/Form/Tests/AbstractLayoutTest.php
Expand Up @@ -1783,8 +1783,7 @@ public function testEmptyRootFormName()
$this->assertMatchesXpath($this->renderWidget($form->createView()),
'//input[@type="hidden"][@id="_token"][@name="_token"]
|
//input[@type="text"][@id="child"][@name="child"]'
, 2);
//input[@type="text"][@id="child"][@name="child"]', 2);
}

public function testButton()
Expand Down
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\Form\Tests\Extension\Core\DataTransformer;

use Symfony\Component\Form\Extension\Core\ChoiceList\SimpleChoiceList;

use Symfony\Component\Form\Extension\Core\DataTransformer\ChoicesToValuesTransformer;

class ChoicesToValuesTransformerTest extends \PHPUnit_Framework_TestCase
Expand Down
Expand Up @@ -11,7 +11,7 @@

namespace Symfony\Component\HttpFoundation\Tests;

use \Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\RedirectResponse;

class RedirectResponseTest extends \PHPUnit_Framework_TestCase
{
Expand Down
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\HttpKernel\Tests\Bundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

use Symfony\Component\HttpKernel\Tests\Fixtures\ExtensionPresentBundle\ExtensionPresentBundle;
use Symfony\Component\HttpKernel\Tests\Fixtures\ExtensionAbsentBundle\ExtensionAbsentBundle;
use Symfony\Component\HttpKernel\Tests\Fixtures\ExtensionPresentBundle\Command\FooCommand;
Expand Down
1 change: 0 additions & 1 deletion src/Symfony/Component/HttpKernel/Tests/ClientTest.php
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\HttpKernel\Tests;

use Symfony\Component\HttpKernel\Client;
use Symfony\Component\HttpKernel\HttpKernel;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\StreamedResponse;
Expand Down
4 changes: 0 additions & 4 deletions src/Symfony/Component/Intl/Intl.php
Expand Up @@ -11,15 +11,11 @@

namespace Symfony\Component\Intl;

use Symfony\Component\Intl\Data\Bundle\Reader\BundleReaderInterface;
use Symfony\Component\Intl\Data\Bundle\Reader\JsonBundleReader;
use Symfony\Component\Intl\Data\Bundle\Reader\IntlBundleReader;
use Symfony\Component\Intl\Data\Bundle\Reader\BufferedBundleReader;
use Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReader;
use Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface;
use Symfony\Component\Intl\Data\Bundle\Reader\PhpBundleReader;
use Symfony\Component\Intl\Data\Provider\ScriptDataProvider;
use Symfony\Component\Intl\Exception\InvalidArgumentException;
use Symfony\Component\Intl\ResourceBundle\CurrencyBundle;
use Symfony\Component\Intl\ResourceBundle\CurrencyBundleInterface;
use Symfony\Component\Intl\ResourceBundle\LanguageBundle;
Expand Down
Expand Up @@ -15,7 +15,6 @@
use Symfony\Component\Intl\Data\Provider\CurrencyDataProvider;
use Symfony\Component\Intl\Data\Provider\LocaleDataProvider;
use Symfony\Component\Intl\Exception\MissingResourceException;
use Symfony\Component\Intl\Intl;

/**
* Default implementation of {@link CurrencyBundleInterface}.
Expand Down
Expand Up @@ -16,7 +16,6 @@
use Symfony\Component\Intl\Data\Provider\LocaleDataProvider;
use Symfony\Component\Intl\Data\Provider\ScriptDataProvider;
use Symfony\Component\Intl\Exception\MissingResourceException;
use Symfony\Component\Intl\Intl;

/**
* Default implementation of {@link LanguageBundleInterface}.
Expand Down
2 changes: 0 additions & 2 deletions src/Symfony/Component/Intl/ResourceBundle/LocaleBundle.php
Expand Up @@ -11,10 +11,8 @@

namespace Symfony\Component\Intl\ResourceBundle;

use Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface;
use Symfony\Component\Intl\Data\Provider\LocaleDataProvider;
use Symfony\Component\Intl\Exception\MissingResourceException;
use Symfony\Component\Intl\Intl;

/**
* Default implementation of {@link LocaleBundleInterface}.
Expand Down
1 change: 0 additions & 1 deletion src/Symfony/Component/Intl/ResourceBundle/RegionBundle.php
Expand Up @@ -15,7 +15,6 @@
use Symfony\Component\Intl\Data\Provider\LocaleDataProvider;
use Symfony\Component\Intl\Data\Provider\RegionDataProvider;
use Symfony\Component\Intl\Exception\MissingResourceException;
use Symfony\Component\Intl\Intl;

/**
* Default implementation of {@link RegionBundleInterface}.
Expand Down
Expand Up @@ -305,8 +305,7 @@ private function compileRoute(Route $route, $name, $supportsRedirections, $paren
}
$vars[] = "array('_route' => '$name')";

$code .= sprintf(" return \$this->mergeDefaults(array_replace(%s), %s);\n"
, implode(', ', $vars), str_replace("\n", '', var_export($route->getDefaults(), true)));
$code .= sprintf(" return \$this->mergeDefaults(array_replace(%s), %s);\n", implode(', ', $vars), str_replace("\n", '', var_export($route->getDefaults(), true)));
} elseif ($route->getDefaults()) {
$code .= sprintf(" return %s;\n", str_replace("\n", '', var_export(array_replace($route->getDefaults(), array('_route' => $name)), true)));
} else {
Expand Down
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\Security\Acl\Domain;

use Symfony\Component\Security\Core\Authentication\Token\AnonymousToken;

use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Acl\Model\SecurityIdentityRetrievalStrategyInterface;
use Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolver;
Expand Down
Expand Up @@ -24,7 +24,7 @@ interface MutableAclProviderInterface extends AclProviderInterface
* @param ObjectIdentityInterface $oid
*
* @throws AclAlreadyExistsException when there already is an ACL for the given
* object identity
* object identity
*
* @return MutableAclInterface
*/
Expand Down
1 change: 0 additions & 1 deletion src/Symfony/Component/Security/Http/HttpUtils.php
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\Security\Http;

use Symfony\Component\Security\Core\SecurityContextInterface;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\Routing\Matcher\UrlMatcherInterface;
Expand Down
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\Security\Tests\Acl\Domain;

use Symfony\Component\Security\Acl\Domain\UserSecurityIdentity;

use Symfony\Component\Security\Acl\Domain\RoleSecurityIdentity;
use Symfony\Component\Security\Acl\Domain\PermissionGrantingStrategy;
use Symfony\Component\Security\Acl\Domain\ObjectIdentity;
Expand Down
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\Security\Tests\Core\Authentication\Provider;

use Symfony\Component\Security\Core\Encoder\PlaintextPasswordEncoder;

use Symfony\Component\Security\Core\Authentication\Provider\DaoAuthenticationProvider;
use Symfony\Component\Security\Core\Exception\UsernameNotFoundException;

Expand Down
Expand Up @@ -12,9 +12,7 @@
namespace Symfony\Component\Security\Tests\Core\User;

use Symfony\Component\Security\Core\Exception\UnsupportedUserException;

use Symfony\Component\Security\Core\User\ChainUserProvider;

use Symfony\Component\Security\Core\Exception\UsernameNotFoundException;

class ChainUserProviderTest extends \PHPUnit_Framework_TestCase
Expand Down
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\Security\Tests\Http\RememberMe;

use Symfony\Component\Security\Http\RememberMe\RememberMeServicesInterface;

use Symfony\Component\Security\Core\Authentication\Token\RememberMeToken;
use Symfony\Component\Security\Core\Exception\UsernameNotFoundException;
use Symfony\Component\Security\Core\Authentication\RememberMe\PersistentToken;
Expand Down
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\Security\Tests\Http\RememberMe;

use Symfony\Component\Security\Http\RememberMe\RememberMeServicesInterface;

use Symfony\Component\Security\Core\Authentication\Token\RememberMeToken;
use Symfony\Component\Security\Core\Exception\UsernameNotFoundException;
use Symfony\Component\HttpFoundation\Request;
Expand Down
3 changes: 1 addition & 2 deletions src/Symfony/Component/Stopwatch/Tests/StopwatchTest.php
Expand Up @@ -59,8 +59,7 @@ public function testIsNotStartedEvent()
$events->setValue(
end($section),
array(
'foo' =>
$this->getMockBuilder('Symfony\Component\Stopwatch\StopwatchEvent')
'foo' => $this->getMockBuilder('Symfony\Component\Stopwatch\StopwatchEvent')
->setConstructorArgs(array(microtime(true) * 1000))
->getMock())
);
Expand Down
1 change: 0 additions & 1 deletion src/Symfony/Component/Yaml/Tests/ParseExceptionTest.php
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\Yaml\Tests;

use Symfony\Component\Yaml\Exception\ParseException;
use Symfony\Component\Yaml\Yaml;

class ParseExceptionTest extends \PHPUnit_Framework_TestCase
{
Expand Down

0 comments on commit cef9972

Please sign in to comment.