From 72e854e9432a3c1324e13e484841400dd2bc269f Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sat, 7 Apr 2012 09:10:50 +0200 Subject: [PATCH] fixed CS --- .../Form/ChoiceList/EntityChoiceList.php | 1 + .../Form/ChoiceList/EntityChoiceListTest.php | 4 +- src/Symfony/Bridge/Twig/TwigEngine.php | 1 - .../Component/ClassLoader/ApcClassLoader.php | 1 + .../Component/ClassLoader/ClassLoader.php | 2 + .../Extension/Core/Type/FieldTypeTest.php | 1 - .../HttpFoundation/Session/Session.php | 1 - .../ConfigurableExtension.php | 2 +- .../DataCollector/EventDataCollectorTest.php | 1 - .../Component/HttpKernel/Tests/KernelTest.php | 1 - .../Process/Exception/ExceptionInterface.php | 42 +++++----- .../Exception/ProcessFailedException.php | 80 +++++++++---------- .../Process/Exception/RuntimeException.php | 42 +++++----- .../Mapping/ClassMetadataFactoryTest.php | 1 - 14 files changed, 89 insertions(+), 91 deletions(-) diff --git a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php index 2debb97e25..aa41d0a330 100644 --- a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php +++ b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php @@ -178,6 +178,7 @@ class EntityChoiceList extends ObjectChoiceList if (empty($values)) { return array(); } + return $this->entityLoader->getEntitiesByIds(current($this->identifier), $values); } diff --git a/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/EntityChoiceListTest.php b/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/EntityChoiceListTest.php index 97867e7591..a21acfdc76 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/EntityChoiceListTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/EntityChoiceListTest.php @@ -251,7 +251,7 @@ class EntityChoiceListTest extends DoctrineOrmTestCase $this->assertEquals(array(1, 2), $choiceList->getValuesForChoices(array($item1, $item2))); $this->assertEquals(array(1, 2), $choiceList->getIndicesForChoices(array($item1, $item2))); } - + // Ticket #3446 public function testGetEmptyArrayChoicesForEmptyValues() { @@ -263,7 +263,7 @@ class EntityChoiceListTest extends DoctrineOrmTestCase null, $entityLoader ); - + $this->assertEquals(array(), $choiceList->getChoicesForValues(array())); } } diff --git a/src/Symfony/Bridge/Twig/TwigEngine.php b/src/Symfony/Bridge/Twig/TwigEngine.php index 5e57b211b2..955d4e0bae 100644 --- a/src/Symfony/Bridge/Twig/TwigEngine.php +++ b/src/Symfony/Bridge/Twig/TwigEngine.php @@ -11,7 +11,6 @@ namespace Symfony\Bridge\Twig; -use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Templating\EngineInterface; use Symfony\Component\Templating\StreamingEngineInterface; use Symfony\Component\Templating\TemplateNameParserInterface; diff --git a/src/Symfony/Component/ClassLoader/ApcClassLoader.php b/src/Symfony/Component/ClassLoader/ApcClassLoader.php index bf70bfc958..3508db6d8a 100644 --- a/src/Symfony/Component/ClassLoader/ApcClassLoader.php +++ b/src/Symfony/Component/ClassLoader/ApcClassLoader.php @@ -94,6 +94,7 @@ class ApcClassLoader { if ($file = $this->findFile($class)) { require $file; + return true; } } diff --git a/src/Symfony/Component/ClassLoader/ClassLoader.php b/src/Symfony/Component/ClassLoader/ClassLoader.php index bb3e4119b6..b94bdb9c15 100644 --- a/src/Symfony/Component/ClassLoader/ClassLoader.php +++ b/src/Symfony/Component/ClassLoader/ClassLoader.php @@ -72,6 +72,7 @@ class ClassLoader foreach ((array) $paths as $path) { $this->fallbackDirs[] = $path; } + return; } if (isset($this->prefixes[$prefix])) { @@ -133,6 +134,7 @@ class ClassLoader { if ($file = $this->findFile($class)) { require $file; + return true; } } diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/FieldTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/FieldTypeTest.php index d1a547c8b7..b588d4433f 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/FieldTypeTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/FieldTypeTest.php @@ -15,7 +15,6 @@ use Symfony\Component\Form\Util\PropertyPath; use Symfony\Component\Form\Form; use Symfony\Component\Form\Tests\Fixtures\Author; use Symfony\Component\Form\Tests\Fixtures\FixedDataTransformer; -use Symfony\Component\Form\Tests\Fixtures\FixedFilterListener; class FieldTypeTest extends TypeTestCase { diff --git a/src/Symfony/Component/HttpFoundation/Session/Session.php b/src/Symfony/Component/HttpFoundation/Session/Session.php index cbadcd38a2..0c40c1c32f 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Session.php +++ b/src/Symfony/Component/HttpFoundation/Session/Session.php @@ -11,7 +11,6 @@ namespace Symfony\Component\HttpFoundation\Session; -use Symfony\Component\HttpFoundation\Session\Storage\MetadataBag; use Symfony\Component\HttpFoundation\Session\Storage\SessionStorageInterface; use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag; use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBagInterface; diff --git a/src/Symfony/Component/HttpKernel/DependencyInjection/ConfigurableExtension.php b/src/Symfony/Component/HttpKernel/DependencyInjection/ConfigurableExtension.php index 13b16ad253..4f6f6a3dd5 100755 --- a/src/Symfony/Component/HttpKernel/DependencyInjection/ConfigurableExtension.php +++ b/src/Symfony/Component/HttpKernel/DependencyInjection/ConfigurableExtension.php @@ -42,4 +42,4 @@ abstract class ConfigurableExtension extends Extension * @param ContainerBuilder $container */ abstract protected function loadInternal(array $mergedConfig, ContainerBuilder $container); -} \ No newline at end of file +} diff --git a/src/Symfony/Component/HttpKernel/Tests/DataCollector/EventDataCollectorTest.php b/src/Symfony/Component/HttpKernel/Tests/DataCollector/EventDataCollectorTest.php index 21f7804ab4..67702c7e96 100644 --- a/src/Symfony/Component/HttpKernel/Tests/DataCollector/EventDataCollectorTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/DataCollector/EventDataCollectorTest.php @@ -14,7 +14,6 @@ namespace Symfony\Component\HttpKernel\Tests\DataCollector; use Symfony\Component\HttpKernel\DataCollector\EventDataCollector; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcherInterface; use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\HttpKernel\Tests\Fixtures\TestEventDispatcher; diff --git a/src/Symfony/Component/HttpKernel/Tests/KernelTest.php b/src/Symfony/Component/HttpKernel/Tests/KernelTest.php index d727f1dc63..eb5d4833e3 100644 --- a/src/Symfony/Component/HttpKernel/Tests/KernelTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/KernelTest.php @@ -17,7 +17,6 @@ use Symfony\Component\HttpKernel\Bundle\Bundle; use Symfony\Component\HttpKernel\HttpKernelInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Config\Loader\LoaderInterface; use Symfony\Component\HttpKernel\Tests\Fixtures\KernelForTest; use Symfony\Component\HttpKernel\Tests\Fixtures\FooBarBundle; diff --git a/src/Symfony/Component/Process/Exception/ExceptionInterface.php b/src/Symfony/Component/Process/Exception/ExceptionInterface.php index 2342a11d3c..75c1c9e5d8 100755 --- a/src/Symfony/Component/Process/Exception/ExceptionInterface.php +++ b/src/Symfony/Component/Process/Exception/ExceptionInterface.php @@ -1,21 +1,21 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Exception; - -/** - * Marker Interface for the Process Component. - * - * @author Johannes M. Schmitt - */ -interface ExceptionInterface -{ -} \ No newline at end of file + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Process\Exception; + +/** + * Marker Interface for the Process Component. + * + * @author Johannes M. Schmitt + */ +interface ExceptionInterface +{ +} diff --git a/src/Symfony/Component/Process/Exception/ProcessFailedException.php b/src/Symfony/Component/Process/Exception/ProcessFailedException.php index c158d91fe8..237476325a 100755 --- a/src/Symfony/Component/Process/Exception/ProcessFailedException.php +++ b/src/Symfony/Component/Process/Exception/ProcessFailedException.php @@ -1,40 +1,40 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Exception; - -use Symfony\Component\Process\Process; - -/** - * Exception for failed processes. - * - * @author Johannes M. Schmitt - */ -class ProcessFailedException extends RuntimeException -{ - private $process; - - public function __construct(Process $process) - { - if ($process->isSuccessful()) { - throw new \InvalidArgumentException('Expected a failed process, but the given process was successful.'); - } - - parent::__construct(sprintf('The command "%s" failed.'."\n\nOutput:\n================\n".$process->getOutput()."\n\nError Output:\n================\n".$process->getErrorOutput())); - - $this->process = $process; - } - - public function getProcess() - { - return $this->process; - } -} + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Process\Exception; + +use Symfony\Component\Process\Process; + +/** + * Exception for failed processes. + * + * @author Johannes M. Schmitt + */ +class ProcessFailedException extends RuntimeException +{ + private $process; + + public function __construct(Process $process) + { + if ($process->isSuccessful()) { + throw new \InvalidArgumentException('Expected a failed process, but the given process was successful.'); + } + + parent::__construct(sprintf('The command "%s" failed.'."\n\nOutput:\n================\n".$process->getOutput()."\n\nError Output:\n================\n".$process->getErrorOutput())); + + $this->process = $process; + } + + public function getProcess() + { + return $this->process; + } +} diff --git a/src/Symfony/Component/Process/Exception/RuntimeException.php b/src/Symfony/Component/Process/Exception/RuntimeException.php index e34e3840d4..adead2536b 100755 --- a/src/Symfony/Component/Process/Exception/RuntimeException.php +++ b/src/Symfony/Component/Process/Exception/RuntimeException.php @@ -1,21 +1,21 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Process\Exception; - -/** - * RuntimeException for the Process Component. - * - * @author Johannes M. Schmitt - */ -class RuntimeException extends \RuntimeException implements ExceptionInterface -{ -} \ No newline at end of file + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Process\Exception; + +/** + * RuntimeException for the Process Component. + * + * @author Johannes M. Schmitt + */ +class RuntimeException extends \RuntimeException implements ExceptionInterface +{ +} diff --git a/src/Symfony/Component/Validator/Tests/Mapping/ClassMetadataFactoryTest.php b/src/Symfony/Component/Validator/Tests/Mapping/ClassMetadataFactoryTest.php index c990586c02..7ee36b49db 100644 --- a/src/Symfony/Component/Validator/Tests/Mapping/ClassMetadataFactoryTest.php +++ b/src/Symfony/Component/Validator/Tests/Mapping/ClassMetadataFactoryTest.php @@ -13,7 +13,6 @@ namespace Symfony\Component\Validator\Tests\Mapping; use Symfony\Component\Validator\Tests\Fixtures\Entity; use Symfony\Component\Validator\Tests\Fixtures\ConstraintA; -use Symfony\Component\Validator\Tests\Fixtures\ConstraintB; use Symfony\Component\Validator\Mapping\ClassMetadataFactory; use Symfony\Component\Validator\Mapping\ClassMetadata; use Symfony\Component\Validator\Mapping\Loader\LoaderInterface;