diff --git a/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php b/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php index 8540f77825..fc341d10b2 100644 --- a/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php +++ b/src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php @@ -48,8 +48,7 @@ class DoctrineOrmTypeGuesser implements FormTypeGuesserInterface return new TypeGuess('entity', array('em' => $name, 'class' => $mapping['targetEntity'], 'multiple' => $multiple), Guess::HIGH_CONFIDENCE); } - switch ($metadata->getTypeOfField($property)) - { + switch ($metadata->getTypeOfField($property)) { //case 'array': // return new TypeGuess('Collection', array(), Guess::HIGH_CONFIDENCE); case 'boolean': diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php index dfbf393164..f32523c561 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php @@ -177,8 +177,7 @@ class Configuration implements ConfigurationInterface private function addTemplatingSection(ArrayNodeDefinition $rootNode) { - $organizeUrls = function($urls) - { + $organizeUrls = function($urls) { $urls += array( 'http' => array(), 'ssl' => array(), diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/HttpKernelTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/HttpKernelTest.php index 9b6c5ad04c..57590d4f00 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/HttpKernelTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/HttpKernelTest.php @@ -48,8 +48,7 @@ class HttpKernelTest extends \PHPUnit_Framework_TestCase $resolver = $this->getMock('Symfony\\Component\\HttpKernel\\Controller\\ControllerResolverInterface'); $kernel = new HttpKernel($dispatcher, $container, $resolver); - $controller = function() use($expected) - { + $controller = function() use($expected) { return $expected; }; @@ -96,8 +95,7 @@ class HttpKernelTest extends \PHPUnit_Framework_TestCase $resolver = $this->getMock('Symfony\\Component\\HttpKernel\\Controller\\ControllerResolverInterface'); $kernel = new HttpKernel($dispatcher, $container, $resolver); - $controller = function() use ($expected) - { + $controller = function() use ($expected) { throw $expected; }; diff --git a/src/Symfony/Component/CssSelector/Tokenizer.php b/src/Symfony/Component/CssSelector/Tokenizer.php index f465180ef8..67d5b67470 100644 --- a/src/Symfony/Component/CssSelector/Tokenizer.php +++ b/src/Symfony/Component/CssSelector/Tokenizer.php @@ -154,8 +154,7 @@ class Tokenizer */ private function unescapeStringLiteral($literal) { - return preg_replace_callback('#(\\\\(?:[A-Fa-f0-9]{1,6}(?:\r\n|\s)?|[^A-Fa-f0-9]))#', function ($matches) use ($literal) - { + return preg_replace_callback('#(\\\\(?:[A-Fa-f0-9]{1,6}(?:\r\n|\s)?|[^A-Fa-f0-9]))#', function ($matches) use ($literal) { if ($matches[0][0] == '\\' && strlen($matches[0]) > 1) { $matches[0] = substr($matches[0], 1); if (in_array($matches[0][0], array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'a', 'b', 'c', 'd', 'e', 'f'))) { diff --git a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php index 2498fa2243..222355171d 100644 --- a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php +++ b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php @@ -1034,8 +1034,7 @@ EOF; return $this->dumpParameter(strtolower($match[1])); } else { $that = $this; - $replaceParameters = function ($match) use ($that) - { + $replaceParameters = function ($match) use ($that) { return "'.".$that->dumpParameter(strtolower($match[2])).".'"; }; diff --git a/src/Symfony/Component/Form/Extension/Csrf/Type/CsrfType.php b/src/Symfony/Component/Form/Extension/Csrf/Type/CsrfType.php index 3e7973240f..cb44e278aa 100644 --- a/src/Symfony/Component/Form/Extension/Csrf/Type/CsrfType.php +++ b/src/Symfony/Component/Form/Extension/Csrf/Type/CsrfType.php @@ -46,8 +46,7 @@ class CsrfType extends AbstractType $csrfProvider = $options['csrf_provider']; $intention = $options['intention']; - $validator = function (FormInterface $form) use ($csrfProvider, $intention) - { + $validator = function (FormInterface $form) use ($csrfProvider, $intention) { if ((!$form->hasParent() || $form->getParent()->isRoot()) && !$csrfProvider->isCsrfTokenValid($intention, $form->getData())) { $form->addError(new FormError('The CSRF token is invalid. Please try to resubmit the form')); diff --git a/src/Symfony/Component/Form/Extension/Validator/Validator/DelegatingValidator.php b/src/Symfony/Component/Form/Extension/Validator/Validator/DelegatingValidator.php index 5c906421c7..599f9e7769 100644 --- a/src/Symfony/Component/Form/Extension/Validator/Validator/DelegatingValidator.php +++ b/src/Symfony/Component/Form/Extension/Validator/Validator/DelegatingValidator.php @@ -168,8 +168,7 @@ class DelegatingValidator implements FormValidatorInterface if ($child->hasChildren() || isset($parts[1])) { $nestedFormPath = $formPath.'['.trim($parts[0], '[]').']'; - } - else { + } else { $nestedFormPath = $formPath.'.data.'.$parts[0]; } diff --git a/src/Symfony/Component/Locale/Resources/data/update-data.php b/src/Symfony/Component/Locale/Resources/data/update-data.php index cd693220b6..aa79d421ec 100644 --- a/src/Symfony/Component/Locale/Resources/data/update-data.php +++ b/src/Symfony/Component/Locale/Resources/data/update-data.php @@ -441,8 +441,7 @@ foreach ($bundle->get('Currencies') as $code => $data) { } // Countries. -$countriesConstraint = function($code) -{ +$countriesConstraint = function($code) { // Global countries (f.i. "America") have numeric codes // Countries have alphabetic codes // "ZZ" is the code for unknown country @@ -456,8 +455,7 @@ $countriesConstraint = function($code) $countries = get_data('Countries', 'region', $defaultLocale, $countriesConstraint); // Languages -$languagesConstraint = function($code) -{ +$languagesConstraint = function($code) { // "mul" is the code for multiple languages if ('mul' !== $code) { return true; diff --git a/src/Symfony/Component/Process/Process.php b/src/Symfony/Component/Process/Process.php index bd0fb18572..c542758dde 100644 --- a/src/Symfony/Component/Process/Process.php +++ b/src/Symfony/Component/Process/Process.php @@ -91,8 +91,7 @@ class Process $this->stdout = ''; $this->stderr = ''; $that = $this; - $callback = function ($type, $data) use ($that, $callback) - { + $callback = function ($type, $data) use ($that, $callback) { if ('out' == $type) { $that->addOutput($data); } else { diff --git a/src/Symfony/Component/Templating/PhpEngine.php b/src/Symfony/Component/Templating/PhpEngine.php index ffa982111e..0fcc1bfd33 100644 --- a/src/Symfony/Component/Templating/PhpEngine.php +++ b/src/Symfony/Component/Templating/PhpEngine.php @@ -441,8 +441,7 @@ class PhpEngine implements EngineInterface, \ArrayAccess * * @return string the escaped value */ - function ($value) use ($that) - { + function ($value) use ($that) { // Numbers and Boolean values get turned into strings which can cause problems // with type comparisons (e.g. === or is_int() etc). return is_string($value) ? htmlspecialchars($value, ENT_QUOTES, $that->getCharset(), false) : $value; @@ -456,14 +455,12 @@ class PhpEngine implements EngineInterface, \ArrayAccess * @param string $value the value to escape * @return string the escaped value */ - function ($value) use ($that) - { + function ($value) use ($that) { if ('UTF-8' != $that->getCharset()) { $value = $that->convertEncoding($value, 'UTF-8', $that->getCharset()); } - $callback = function ($matches) use ($that) - { + $callback = function ($matches) use ($that) { $char = $matches[0]; // \xHH diff --git a/tests/Symfony/Tests/Component/Config/Definition/ArrayNodeTest.php b/tests/Symfony/Tests/Component/Config/Definition/ArrayNodeTest.php index 1d262a7934..64e7583ec9 100644 --- a/tests/Symfony/Tests/Component/Config/Definition/ArrayNodeTest.php +++ b/tests/Symfony/Tests/Component/Config/Definition/ArrayNodeTest.php @@ -31,8 +31,7 @@ class ArrayNodeTest extends \PHPUnit_Framework_TestCase { $node = new ArrayNode('root'); - try - { + try { $node->normalize(array('foo' => 'bar')); $this->fail('An exception should have been throw for a bad child node'); } catch (\Exception $e) { diff --git a/tests/Symfony/Tests/Component/Console/Command/CommandTest.php b/tests/Symfony/Tests/Component/Console/Command/CommandTest.php index 81371c019f..df1b354e11 100644 --- a/tests/Symfony/Tests/Component/Console/Command/CommandTest.php +++ b/tests/Symfony/Tests/Component/Console/Command/CommandTest.php @@ -216,8 +216,7 @@ class CommandTest extends \PHPUnit_Framework_TestCase public function testSetCode() { $command = new \TestCommand(); - $ret = $command->setCode(function (InputInterface $input, OutputInterface $output) - { + $ret = $command->setCode(function (InputInterface $input, OutputInterface $output) { $output->writeln('from the code...'); }); $this->assertEquals($command, $ret, '->setCode() implements a fluent interface'); diff --git a/tests/Symfony/Tests/Component/DependencyInjection/Loader/ClosureLoaderTest.php b/tests/Symfony/Tests/Component/DependencyInjection/Loader/ClosureLoaderTest.php index eeffb8c125..4bea8e9818 100644 --- a/tests/Symfony/Tests/Component/DependencyInjection/Loader/ClosureLoaderTest.php +++ b/tests/Symfony/Tests/Component/DependencyInjection/Loader/ClosureLoaderTest.php @@ -34,8 +34,7 @@ class ClosureLoaderTest extends \PHPUnit_Framework_TestCase { $loader = new ClosureLoader($container = new ContainerBuilder()); - $loader->load(function ($container) - { + $loader->load(function ($container) { $container->setParameter('foo', 'foo'); }); diff --git a/tests/Symfony/Tests/Component/DomCrawler/CrawlerTest.php b/tests/Symfony/Tests/Component/DomCrawler/CrawlerTest.php index 53bc9b6925..403b13a555 100644 --- a/tests/Symfony/Tests/Component/DomCrawler/CrawlerTest.php +++ b/tests/Symfony/Tests/Component/DomCrawler/CrawlerTest.php @@ -177,8 +177,7 @@ class CrawlerTest extends \PHPUnit_Framework_TestCase public function testEach() { - $data = $this->createTestCrawler()->filter('ul.first li')->each(function ($node, $i) - { + $data = $this->createTestCrawler()->filter('ul.first li')->each(function ($node, $i) { return $i.'-'.$node->nodeValue; }); @@ -188,8 +187,7 @@ class CrawlerTest extends \PHPUnit_Framework_TestCase public function testReduce() { $crawler = $this->createTestCrawler()->filter('ul.first li'); - $nodes = $crawler->reduce(function ($node, $i) - { + $nodes = $crawler->reduce(function ($node, $i) { return $i == 1 ? false : true; }); $this->assertNotSame($nodes, $crawler, '->reduce() returns a new instance of a crawler'); diff --git a/tests/Symfony/Tests/Component/Form/Extension/Core/Type/CheckboxTypeTest.php b/tests/Symfony/Tests/Component/Form/Extension/Core/Type/CheckboxTypeTest.php index 129dac3043..ebbdfb3aa0 100644 --- a/tests/Symfony/Tests/Component/Form/Extension/Core/Type/CheckboxTypeTest.php +++ b/tests/Symfony/Tests/Component/Form/Extension/Core/Type/CheckboxTypeTest.php @@ -48,12 +48,10 @@ class CheckboxTypeTest extends TypeTestCase { // present a binary status field as a checkbox $transformer = new CallbackTransformer( - function ($value) - { + function ($value) { return 'expedited' == $value; }, - function ($value) - { + function ($value) { return $value ? 'expedited' : 'standard'; } ); diff --git a/tests/Symfony/Tests/Component/HttpFoundation/ResponseTest.php b/tests/Symfony/Tests/Component/HttpFoundation/ResponseTest.php index 2ad4ad7792..26af05df7f 100644 --- a/tests/Symfony/Tests/Component/HttpFoundation/ResponseTest.php +++ b/tests/Symfony/Tests/Component/HttpFoundation/ResponseTest.php @@ -334,8 +334,7 @@ class ResponseTest extends \PHPUnit_Framework_TestCase public function testIsRedirectRedirection() { - foreach (array(301, 302, 303, 307) as $code) - { + foreach (array(301, 302, 303, 307) as $code) { $response = new Response('', $code); $this->assertTrue($response->isRedirection()); $this->assertTrue($response->isRedirect()); @@ -369,8 +368,7 @@ class ResponseTest extends \PHPUnit_Framework_TestCase public function testIsEmpty() { - foreach (array(201, 204, 304) as $code) - { + foreach (array(201, 204, 304) as $code) { $response = new Response('', $code); $this->assertTrue($response->isEmpty()); } diff --git a/tests/Symfony/Tests/Component/HttpKernel/HttpCache/HttpCacheTest.php b/tests/Symfony/Tests/Component/HttpKernel/HttpCache/HttpCacheTest.php index f7c5d5cc0f..0ad8d1a6a8 100644 --- a/tests/Symfony/Tests/Component/HttpKernel/HttpCache/HttpCacheTest.php +++ b/tests/Symfony/Tests/Component/HttpKernel/HttpCache/HttpCacheTest.php @@ -124,8 +124,7 @@ class HttpCacheTest extends HttpCacheTestCase { $time = new \DateTime(); - $this->setNextResponse(200, array(), '', function ($request, $response) use ($time) - { + $this->setNextResponse(200, array(), '', function ($request, $response) use ($time) { $response->setStatusCode(200); $response->headers->set('ETag', '12345'); $response->headers->set('Last-Modified', $time->format(DATE_RFC2822)); @@ -152,8 +151,7 @@ class HttpCacheTest extends HttpCacheTestCase public function testValidatesPrivateResponsesCachedOnTheClient() { - $this->setNextResponse(200, array(), '', function ($request, $response) - { + $this->setNextResponse(200, array(), '', function ($request, $response) { $etags = preg_split('/\s*,\s*/', $request->headers->get('IF_NONE_MATCH')); if ($request->cookies->has('authenticated')) { $response->headers->set('Cache-Control', 'private, no-store'); @@ -212,8 +210,7 @@ class HttpCacheTest extends HttpCacheTestCase { $count = 0; - $this->setNextResponse(200, array('Cache-Control' => 'public, max-age=10000'), '', function ($request, $response) use (&$count) - { + $this->setNextResponse(200, array('Cache-Control' => 'public, max-age=10000'), '', function ($request, $response) use (&$count) { ++$count; $response->setContent(1 == $count ? 'Hello World' : 'Goodbye World'); }); @@ -240,8 +237,7 @@ class HttpCacheTest extends HttpCacheTestCase { $count = 0; - $this->setNextResponse(200, array('Cache-Control' => 'public, max-age=10000'), '', function ($request, $response) use (&$count) - { + $this->setNextResponse(200, array('Cache-Control' => 'public, max-age=10000'), '', function ($request, $response) use (&$count) { ++$count; $response->setContent(1 == $count ? 'Hello World' : 'Goodbye World'); }); @@ -272,8 +268,7 @@ class HttpCacheTest extends HttpCacheTestCase { $count = 0; - $this->setNextResponse(200, array(), '', function ($request, $response) use (&$count) - { + $this->setNextResponse(200, array(), '', function ($request, $response) use (&$count) { ++$count; $response->headers->set('Cache-Control', 'public, max-age=10000'); $response->setETag($count); @@ -303,8 +298,7 @@ class HttpCacheTest extends HttpCacheTestCase { $count = 0; - $this->setNextResponse(200, array(), '', function ($request, $response) use (&$count) - { + $this->setNextResponse(200, array(), '', function ($request, $response) use (&$count) { ++$count; $response->headers->set('Cache-Control', 'public, max-age=10000'); $response->setETag($count); @@ -613,8 +607,7 @@ class HttpCacheTest extends HttpCacheTestCase public function testValidatesCachedResponsesWithLastModifiedAndNoFreshnessInformation() { $time = \DateTime::createFromFormat('U', time()); - $this->setNextResponse(200, array(), 'Hello World', function ($request, $response) use ($time) - { + $this->setNextResponse(200, array(), 'Hello World', function ($request, $response) use ($time) { $response->headers->set('Cache-Control', 'public'); $response->headers->set('Last-Modified', $time->format(DATE_RFC2822)); if ($time->format(DATE_RFC2822) == $request->headers->get('IF_MODIFIED_SINCE')) { @@ -650,8 +643,7 @@ class HttpCacheTest extends HttpCacheTestCase public function testValidatesCachedResponsesWithETagAndNoFreshnessInformation() { - $this->setNextResponse(200, array(), 'Hello World', function ($request, $response) - { + $this->setNextResponse(200, array(), 'Hello World', function ($request, $response) { $response->headers->set('Cache-Control', 'public'); $response->headers->set('ETag', '"12345"'); if ($response->getETag() == $request->headers->get('IF_NONE_MATCH')) { @@ -688,8 +680,7 @@ class HttpCacheTest extends HttpCacheTestCase { $time = \DateTime::createFromFormat('U', time()); $count = 0; - $this->setNextResponse(200, array(), 'Hello World', function ($request, $response) use ($time, &$count) - { + $this->setNextResponse(200, array(), 'Hello World', function ($request, $response) use ($time, &$count) { $response->headers->set('Last-Modified', $time->format(DATE_RFC2822)); $response->headers->set('Cache-Control', 'public'); switch (++$count) { @@ -727,8 +718,7 @@ class HttpCacheTest extends HttpCacheTestCase public function testPassesHeadRequestsThroughDirectlyOnPass() { $that = $this; - $this->setNextResponse(200, array(), 'Hello World', function ($request, $response) use ($that) - { + $this->setNextResponse(200, array(), 'Hello World', function ($request, $response) use ($that) { $response->setContent(''); $response->setStatusCode(200); $that->assertEquals('HEAD', $request->getMethod()); @@ -742,8 +732,7 @@ class HttpCacheTest extends HttpCacheTestCase public function testUsesCacheToRespondToHeadRequestsWhenFresh() { $that = $this; - $this->setNextResponse(200, array(), 'Hello World', function ($request, $response) use ($that) - { + $this->setNextResponse(200, array(), 'Hello World', function ($request, $response) use ($that) { $response->headers->set('Cache-Control', 'public, max-age=10'); $response->setContent('Hello World'); $response->setStatusCode(200); @@ -765,8 +754,7 @@ class HttpCacheTest extends HttpCacheTestCase { $time = \DateTime::createFromFormat('U', time()); $that = $this; - $this->setNextResponse(200, array(), 'Hello World', function ($request, $response) use ($that, $time) - { + $this->setNextResponse(200, array(), 'Hello World', function ($request, $response) use ($that, $time) { $response->headers->set('Cache-Control', 'public, max-age=10'); $response->headers->set('Last-Modified', $time->format(DATE_RFC2822)); }); @@ -783,8 +771,7 @@ class HttpCacheTest extends HttpCacheTestCase public function testInvalidatesCachedResponsesOnPost() { - $this->setNextResponse(200, array(), 'Hello World', function ($request, $response) - { + $this->setNextResponse(200, array(), 'Hello World', function ($request, $response) { if ('GET' == $request->getMethod()) { $response->setStatusCode(200); $response->headers->set('Cache-Control', 'public, max-age=500'); @@ -833,8 +820,7 @@ class HttpCacheTest extends HttpCacheTestCase public function testServesFromCacheWhenHeadersMatch() { $count = 0; - $this->setNextResponse(200, array('Cache-Control' => 'max-age=10000'), '', function ($request, $response) use (&$count) - { + $this->setNextResponse(200, array('Cache-Control' => 'max-age=10000'), '', function ($request, $response) use (&$count) { $response->headers->set('Vary', 'Accept User-Agent Foo'); $response->headers->set('Cache-Control', 'public, max-age=10'); $response->headers->set('X-Response-Count', ++$count); @@ -858,8 +844,7 @@ class HttpCacheTest extends HttpCacheTestCase public function testStoresMultipleResponsesWhenHeadersDiffer() { $count = 0; - $this->setNextResponse(200, array('Cache-Control' => 'max-age=10000'), '', function ($request, $response) use (&$count) - { + $this->setNextResponse(200, array('Cache-Control' => 'max-age=10000'), '', function ($request, $response) use (&$count) { $response->headers->set('Vary', 'Accept User-Agent Foo'); $response->headers->set('Cache-Control', 'public, max-age=10'); $response->headers->set('X-Response-Count', ++$count); diff --git a/tests/Symfony/Tests/Component/HttpKernel/HttpCache/HttpCacheTestCase.php b/tests/Symfony/Tests/Component/HttpKernel/HttpCache/HttpCacheTestCase.php index 6d0f5b74ee..b9f287a19e 100644 --- a/tests/Symfony/Tests/Component/HttpKernel/HttpCache/HttpCacheTestCase.php +++ b/tests/Symfony/Tests/Component/HttpKernel/HttpCache/HttpCacheTestCase.php @@ -161,8 +161,7 @@ class HttpCacheTestCase extends \PHPUnit_Framework_TestCase $fp = opendir($directory); while (false !== $file = readdir($fp)) { - if (!in_array($file, array('.', '..'))) - { + if (!in_array($file, array('.', '..'))) { if (is_link($directory.'/'.$file)) { unlink($directory.'/'.$file); } elseif (is_dir($directory.'/'.$file)) { diff --git a/tests/Symfony/Tests/Component/HttpKernel/HttpKernelTest.php b/tests/Symfony/Tests/Component/HttpKernel/HttpKernelTest.php index 149cbeb8de..410074498c 100644 --- a/tests/Symfony/Tests/Component/HttpKernel/HttpKernelTest.php +++ b/tests/Symfony/Tests/Component/HttpKernel/HttpKernelTest.php @@ -43,8 +43,7 @@ class HttpKernelTest extends \PHPUnit_Framework_TestCase public function testHandleWhenControllerThrowsAnExceptionAndRawIsFalse() { $dispatcher = new EventDispatcher(); - $dispatcher->addListener(KernelEvents::EXCEPTION, function ($event) - { + $dispatcher->addListener(KernelEvents::EXCEPTION, function ($event) { $event->setResponse(new Response($event->getException()->getMessage())); }); @@ -56,8 +55,7 @@ class HttpKernelTest extends \PHPUnit_Framework_TestCase public function testHandleWhenAListenerReturnsAResponse() { $dispatcher = new EventDispatcher(); - $dispatcher->addListener(KernelEvents::REQUEST, function ($event) - { + $dispatcher->addListener(KernelEvents::REQUEST, function ($event) { $event->setResponse(new Response('hello')); }); @@ -143,8 +141,7 @@ class HttpKernelTest extends \PHPUnit_Framework_TestCase public function testHandleWhenTheControllerDoesNotReturnAResponseButAViewIsRegistered() { $dispatcher = new EventDispatcher(); - $dispatcher->addListener(KernelEvents::VIEW, function ($event) - { + $dispatcher->addListener(KernelEvents::VIEW, function ($event) { $event->setResponse(new Response($event->getControllerResult())); }); $kernel = new HttpKernel($dispatcher, $this->getResolver(function () { return 'foo'; })); @@ -155,8 +152,7 @@ class HttpKernelTest extends \PHPUnit_Framework_TestCase public function testHandleWithAResponseListener() { $dispatcher = new EventDispatcher(); - $dispatcher->addListener(KernelEvents::RESPONSE, function ($event) - { + $dispatcher->addListener(KernelEvents::RESPONSE, function ($event) { $event->setResponse(new Response('foo')); }); $kernel = new HttpKernel($dispatcher, $this->getResolver()); diff --git a/tests/Symfony/Tests/Component/Process/ProcessTest.php b/tests/Symfony/Tests/Component/Process/ProcessTest.php index cf72886794..2bc746c461 100644 --- a/tests/Symfony/Tests/Component/Process/ProcessTest.php +++ b/tests/Symfony/Tests/Component/Process/ProcessTest.php @@ -87,8 +87,7 @@ class ProcessTest extends \PHPUnit_Framework_TestCase $baseData = str_repeat('*', 1024); $codes = array(); - foreach (array(1, 16, 64, 1024, 4096) as $size) - { + foreach (array(1, 16, 64, 1024, 4096) as $size) { $data = str_repeat($baseData, $size) . '!'; foreach ($variations as $code) { $codes[] = array($data, $code); diff --git a/tests/Symfony/Tests/Component/Process/ProcessTestHelper.php b/tests/Symfony/Tests/Component/Process/ProcessTestHelper.php index 63548c9e61..25cfb41f93 100644 --- a/tests/Symfony/Tests/Component/Process/ProcessTestHelper.php +++ b/tests/Symfony/Tests/Component/Process/ProcessTestHelper.php @@ -25,8 +25,7 @@ while ($read || $write) { die(ERR_TIMEOUT); } - if (in_array(STDOUT, $w) && strlen($out) > 0) - { + if (in_array(STDOUT, $w) && strlen($out) > 0) { $written = fwrite(STDOUT, (binary) $out, 1024); if (false === $written) { die(ERR_WRITE_FAILED); @@ -37,8 +36,7 @@ while ($read || $write) { $write = array_diff($write, array(STDOUT)); } - if (in_array(STDERR, $w) && strlen($err) > 0) - { + if (in_array(STDERR, $w) && strlen($err) > 0) { $written = fwrite(STDERR, (binary) $err, 1024); if (false === $written) { die(ERR_WRITE_FAILED); diff --git a/tests/Symfony/Tests/Component/Routing/Loader/ClosureLoaderTest.php b/tests/Symfony/Tests/Component/Routing/Loader/ClosureLoaderTest.php index c64655204d..f84be241d7 100644 --- a/tests/Symfony/Tests/Component/Routing/Loader/ClosureLoaderTest.php +++ b/tests/Symfony/Tests/Component/Routing/Loader/ClosureLoaderTest.php @@ -41,8 +41,7 @@ class ClosureLoaderTest extends \PHPUnit_Framework_TestCase $loader = new ClosureLoader(); $route = new Route('/'); - $routes = $loader->load(function () use ($route) - { + $routes = $loader->load(function () use ($route) { $routes = new RouteCollection(); $routes->add('foo', $route); diff --git a/tests/Symfony/Tests/Component/Security/Acl/Dbal/AclProviderBenchmarkTest.php b/tests/Symfony/Tests/Component/Security/Acl/Dbal/AclProviderBenchmarkTest.php index 56f0ffcce1..e206313b46 100644 --- a/tests/Symfony/Tests/Component/Security/Acl/Dbal/AclProviderBenchmarkTest.php +++ b/tests/Symfony/Tests/Component/Security/Acl/Dbal/AclProviderBenchmarkTest.php @@ -183,8 +183,7 @@ class AclProviderBenchmarkTest extends \PHPUnit_Framework_TestCase do { $sid = $this->chooseSid(); - } - while (array_key_exists($sid, $sids) && in_array($fieldName, $sids[$sid], true)); + } while (array_key_exists($sid, $sids) && in_array($fieldName, $sids[$sid], true)); $fieldOrder[$fieldName] = array_key_exists($fieldName, $fieldOrder) ? $fieldOrder[$fieldName]+1 : 0; if (!isset($sids[$sid])) {