diff --git a/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php b/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php index 0385a1dd7f..b34b9bdec4 100644 --- a/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php +++ b/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php @@ -85,10 +85,10 @@ class EntityUserProvider implements UserProviderInterface // That's the case when the user has been changed by a form with // validation errors. if (!$id = $this->metadata->getIdentifierValues($user)) { - throw new \InvalidArgumentException("You cannot refresh a user ". - "from the EntityUserProvider that does not contain an identifier. ". - "The user object has to be serialized with its own identifier ". - "mapped by Doctrine." + throw new \InvalidArgumentException('You cannot refresh a user '. + 'from the EntityUserProvider that does not contain an identifier. '. + 'The user object has to be serialized with its own identifier '. + 'mapped by Doctrine.' ); } diff --git a/src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php b/src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php index bad478c568..1870aa650c 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php @@ -39,7 +39,7 @@ class DoctrineDataCollectorTest extends \PHPUnit_Framework_TestCase $this->assertEquals(0, $c->getQueryCount()); $queries = array( - array('sql' => "SELECT * FROM table1", 'params' => array(), 'types' => array(), 'executionMS' => 0), + array('sql' => 'SELECT * FROM table1', 'params' => array(), 'types' => array(), 'executionMS' => 0), ); $c = $this->createCollector($queries); $c->collect(new Request(), new Response()); @@ -53,15 +53,15 @@ class DoctrineDataCollectorTest extends \PHPUnit_Framework_TestCase $this->assertEquals(0, $c->getTime()); $queries = array( - array('sql' => "SELECT * FROM table1", 'params' => array(), 'types' => array(), 'executionMS' => 1), + array('sql' => 'SELECT * FROM table1', 'params' => array(), 'types' => array(), 'executionMS' => 1), ); $c = $this->createCollector($queries); $c->collect(new Request(), new Response()); $this->assertEquals(1, $c->getTime()); $queries = array( - array('sql' => "SELECT * FROM table1", 'params' => array(), 'types' => array(), 'executionMS' => 1), - array('sql' => "SELECT * FROM table2", 'params' => array(), 'types' => array(), 'executionMS' => 2), + array('sql' => 'SELECT * FROM table1', 'params' => array(), 'types' => array(), 'executionMS' => 1), + array('sql' => 'SELECT * FROM table2', 'params' => array(), 'types' => array(), 'executionMS' => 2), ); $c = $this->createCollector($queries); $c->collect(new Request(), new Response()); @@ -74,7 +74,7 @@ class DoctrineDataCollectorTest extends \PHPUnit_Framework_TestCase public function testCollectQueries($param, $types, $expected, $explainable) { $queries = array( - array('sql' => "SELECT * FROM table1 WHERE field1 = ?1", 'params' => array($param), 'types' => $types, 'executionMS' => 1), + array('sql' => 'SELECT * FROM table1 WHERE field1 = ?1', 'params' => array($param), 'types' => $types, 'executionMS' => 1), ); $c = $this->createCollector($queries); $c->collect(new Request(), new Response()); @@ -90,7 +90,7 @@ class DoctrineDataCollectorTest extends \PHPUnit_Framework_TestCase public function testSerialization($param, $types, $expected, $explainable) { $queries = array( - array('sql' => "SELECT * FROM table1 WHERE field1 = ?1", 'params' => array($param), 'types' => $types, 'executionMS' => 1), + array('sql' => 'SELECT * FROM table1 WHERE field1 = ?1', 'params' => array($param), 'types' => $types, 'executionMS' => 1), ); $c = $this->createCollector($queries); $c->collect(new Request(), new Response()); diff --git a/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php b/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php index 1565e6ffb4..4fefe1d523 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php @@ -244,11 +244,11 @@ class UniqueEntityValidatorTest extends AbstractConstraintValidatorTest 'message' => 'myMessage', 'fields' => array('name', 'name2'), 'em' => self::EM_NAME, - 'errorPath' => "name2", + 'errorPath' => 'name2', )); - $entity1 = new DoubleNameEntity(1, 'Foo', "Bar"); - $entity2 = new DoubleNameEntity(2, 'Foo', "Bar"); + $entity1 = new DoubleNameEntity(1, 'Foo', 'Bar'); + $entity2 = new DoubleNameEntity(2, 'Foo', 'Bar'); $this->validator->validate($entity1, $constraint); @@ -399,7 +399,7 @@ class UniqueEntityValidatorTest extends AbstractConstraintValidatorTest 'em' => self::EM_NAME, )); - $composite = new CompositeIntIdEntity(1, 1, "test"); + $composite = new CompositeIntIdEntity(1, 1, 'test'); $associated = new AssociationEntity(); $associated->composite = $composite; diff --git a/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php b/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php index 4c6724a136..82704a3535 100644 --- a/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php +++ b/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php @@ -98,8 +98,8 @@ class UniqueEntityValidator extends ConstraintValidator if (count($relatedId) > 1) { throw new ConstraintDefinitionException( - "Associated entities are not allowed to have more than one identifier field to be ". - "part of a unique constraint in: ".$class->getName()."#".$fieldName + 'Associated entities are not allowed to have more than one identifier field to be '. + 'part of a unique constraint in: '.$class->getName().'#'.$fieldName ); } $criteria[$fieldName] = array_pop($relatedId); diff --git a/src/Symfony/Bridge/Propel1/Tests/DataCollector/PropelDataCollectorTest.php b/src/Symfony/Bridge/Propel1/Tests/DataCollector/PropelDataCollectorTest.php index c709f235cd..f92e43e598 100644 --- a/src/Symfony/Bridge/Propel1/Tests/DataCollector/PropelDataCollectorTest.php +++ b/src/Symfony/Bridge/Propel1/Tests/DataCollector/PropelDataCollectorTest.php @@ -51,7 +51,7 @@ class PropelDataCollectorTest extends Propel1TestCase { $queries = array( "time: 0.000 sec | mem: 1.4 MB | connection: default | SET NAMES 'utf8'", - "time: 0.012 sec | mem: 2.4 MB | connection: default | SELECT tags.NAME, image.FILENAME FROM tags LEFT JOIN image ON tags.IMAGEID = image.ID WHERE image.ID = 12", + 'time: 0.012 sec | mem: 2.4 MB | connection: default | SELECT tags.NAME, image.FILENAME FROM tags LEFT JOIN image ON tags.IMAGEID = image.ID WHERE image.ID = 12', "time: 0.012 sec | mem: 2.4 MB | connection: default | INSERT INTO `table` (`some_array`) VALUES ('| 1 | 2 | 3 |')", ); @@ -66,7 +66,7 @@ class PropelDataCollectorTest extends Propel1TestCase 'memory' => '1.4 MB', ), array( - 'sql' => "SELECT tags.NAME, image.FILENAME FROM tags LEFT JOIN image ON tags.IMAGEID = image.ID WHERE image.ID = 12", + 'sql' => 'SELECT tags.NAME, image.FILENAME FROM tags LEFT JOIN image ON tags.IMAGEID = image.ID WHERE image.ID = 12', 'time' => '0.012 sec', 'connection' => 'default', 'memory' => '2.4 MB', diff --git a/src/Symfony/Bridge/Twig/Extension/CodeExtension.php b/src/Symfony/Bridge/Twig/Extension/CodeExtension.php index d3f52dd5df..4a0c1e9c76 100644 --- a/src/Symfony/Bridge/Twig/Extension/CodeExtension.php +++ b/src/Symfony/Bridge/Twig/Extension/CodeExtension.php @@ -65,7 +65,7 @@ class CodeExtension extends \Twig_Extension { if (false !== strpos($method, '::')) { list($class, $method) = explode('::', $method, 2); - $result = sprintf("%s::%s()", $this->abbrClass($class), $method); + $result = sprintf('%s::%s()', $this->abbrClass($class), $method); } elseif ('Closure' === $method) { $result = sprintf("%s", $method, $method); } else { @@ -91,7 +91,7 @@ class CodeExtension extends \Twig_Extension $short = array_pop($parts); $formattedValue = sprintf("object(%s)", $item[1], $short); } elseif ('array' === $item[0]) { - $formattedValue = sprintf("array(%s)", is_array($item[1]) ? $this->formatArgs($item[1]) : $item[1]); + $formattedValue = sprintf('array(%s)', is_array($item[1]) ? $this->formatArgs($item[1]) : $item[1]); } elseif ('string' === $item[0]) { $formattedValue = sprintf("'%s'", htmlspecialchars($item[1], ENT_QUOTES, $this->charset)); } elseif ('null' === $item[0]) { diff --git a/src/Symfony/Bridge/Twig/Node/SearchAndRenderBlockNode.php b/src/Symfony/Bridge/Twig/Node/SearchAndRenderBlockNode.php index 630e2638dd..93bba43b4c 100644 --- a/src/Symfony/Bridge/Twig/Node/SearchAndRenderBlockNode.php +++ b/src/Symfony/Bridge/Twig/Node/SearchAndRenderBlockNode.php @@ -101,6 +101,6 @@ class SearchAndRenderBlockNode extends \Twig_Node_Expression_Function } } - $compiler->raw(")"); + $compiler->raw(')'); } } diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php index 31f58e85f8..61182fa71e 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/AssetsInstallCommand.php @@ -83,7 +83,7 @@ EOT $bundlesDir = $targetArg.'/bundles/'; $filesystem->mkdir($bundlesDir, 0777); - $output->writeln(sprintf("Installing assets using the %s option", $input->getOption('symlink') ? 'symlink' : 'hard copy')); + $output->writeln(sprintf('Installing assets using the %s option', $input->getOption('symlink') ? 'symlink' : 'hard copy')); foreach ($this->getContainer()->get('kernel')->getBundles() as $bundle) { if (is_dir($originDir = $bundle->getPath().'/Resources/public')) { diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php index a55bbb9895..d58031fb7d 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php @@ -207,12 +207,12 @@ EOF } } $format = '%-'.$maxName.'s '; - $format .= implode("", array_map(function ($length) { return "%-{$length}s "; }, $maxTags)); + $format .= implode('', array_map(function ($length) { return "%-{$length}s "; }, $maxTags)); $format .= '%-'.$maxScope.'s %s'; // the title field needs extra space to make up for comment tags $format1 = '%-'.($maxName + 19).'s '; - $format1 .= implode("", array_map(function ($length) { return '%-'.($length + 19).'s '; }, $maxTags)); + $format1 .= implode('', array_map(function ($length) { return '%-'.($length + 19).'s '; }, $maxTags)); $format1 .= '%-'.($maxScope + 19).'s %s'; $tags = array(); @@ -230,7 +230,7 @@ EOF foreach ($definition->getTag($showTagAttributes) as $key => $tag) { $tagValues = array(); foreach (array_keys($maxTags) as $tagName) { - $tagValues[] = isset($tag[$tagName]) ? $tag[$tagName] : ""; + $tagValues[] = isset($tag[$tagName]) ? $tag[$tagName] : ''; } if (0 === $key) { $lines[] = $this->buildArgumentsArray($serviceId, $definition->getScope(), $definition->getClass(), $tagValues); @@ -247,11 +247,11 @@ EOF } } elseif ($definition instanceof Alias) { $alias = $definition; - $output->writeln(vsprintf($format, $this->buildArgumentsArray($serviceId, 'n/a', sprintf('alias for %s', (string) $alias), count($maxTags) ? array_fill(0, count($maxTags), "") : array()))); + $output->writeln(vsprintf($format, $this->buildArgumentsArray($serviceId, 'n/a', sprintf('alias for %s', (string) $alias), count($maxTags) ? array_fill(0, count($maxTags), '') : array()))); } else { // we have no information (happens with "service_container") $service = $definition; - $output->writeln(vsprintf($format, $this->buildArgumentsArray($serviceId, '', get_class($service), count($maxTags) ? array_fill(0, count($maxTags), "") : array()))); + $output->writeln(vsprintf($format, $this->buildArgumentsArray($serviceId, '', get_class($service), count($maxTags) ? array_fill(0, count($maxTags), '') : array()))); } } } @@ -281,7 +281,7 @@ EOF if ($definition instanceof Definition) { $output->writeln(sprintf('Service Id %s', $serviceId)); - $output->writeln(sprintf('Class %s', $definition->getClass() ?: "-")); + $output->writeln(sprintf('Class %s', $definition->getClass() ?: '-')); $tags = $definition->getTags(); if (count($tags)) { diff --git a/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/CodeHelper.php b/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/CodeHelper.php index f04bb5e628..94a9af0cc0 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/CodeHelper.php +++ b/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/CodeHelper.php @@ -62,7 +62,7 @@ class CodeHelper extends Helper { if (false !== strpos($method, '::')) { list($class, $method) = explode('::', $method, 2); - $result = sprintf("%s::%s()", $this->abbrClass($class), $method); + $result = sprintf('%s::%s()', $this->abbrClass($class), $method); } elseif ('Closure' === $method) { $result = sprintf("%s", $method, $method); } else { @@ -88,7 +88,7 @@ class CodeHelper extends Helper $short = array_pop($parts); $formattedValue = sprintf("object(%s)", $item[1], $short); } elseif ('array' === $item[0]) { - $formattedValue = sprintf("array(%s)", is_array($item[1]) ? $this->formatArgs($item[1]) : $item[1]); + $formattedValue = sprintf('array(%s)', is_array($item[1]) ? $this->formatArgs($item[1]) : $item[1]); } elseif ('string' === $item[0]) { $formattedValue = sprintf("'%s'", htmlspecialchars($item[1], ENT_QUOTES, $this->getCharset())); } elseif ('null' === $item[0]) { diff --git a/src/Symfony/Bundle/FrameworkBundle/Templating/Loader/TemplateLocator.php b/src/Symfony/Bundle/FrameworkBundle/Templating/Loader/TemplateLocator.php index 1dc9ce56e2..286b7c62e4 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Templating/Loader/TemplateLocator.php +++ b/src/Symfony/Bundle/FrameworkBundle/Templating/Loader/TemplateLocator.php @@ -66,7 +66,7 @@ class TemplateLocator implements FileLocatorInterface public function locate($template, $currentPath = null, $first = true) { if (!$template instanceof TemplateReferenceInterface) { - throw new \InvalidArgumentException("The template must be an instance of TemplateReferenceInterface."); + throw new \InvalidArgumentException('The template must be an instance of TemplateReferenceInterface.'); } $key = $this->getCacheKey($template); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/RedirectControllerTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/RedirectControllerTest.php index a892c711a3..fa56a5ad08 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/RedirectControllerTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/RedirectControllerTest.php @@ -155,30 +155,30 @@ class RedirectControllerTest extends TestCase { return array( // Standard ports - array('http', null, null, 'http', 80, ""), - array('http', 80, null, 'http', 80, ""), - array('https', null, null, 'http', 80, ""), - array('https', 80, null, 'http', 80, ""), + array('http', null, null, 'http', 80, ''), + array('http', 80, null, 'http', 80, ''), + array('https', null, null, 'http', 80, ''), + array('https', 80, null, 'http', 80, ''), - array('http', null, null, 'https', 443, ""), - array('http', null, 443, 'https', 443, ""), - array('https', null, null, 'https', 443, ""), - array('https', null, 443, 'https', 443, ""), + array('http', null, null, 'https', 443, ''), + array('http', null, 443, 'https', 443, ''), + array('https', null, null, 'https', 443, ''), + array('https', null, 443, 'https', 443, ''), // Non-standard ports - array('http', null, null, 'http', 8080, ":8080"), - array('http', 4080, null, 'http', 8080, ":4080"), - array('http', 80, null, 'http', 8080, ""), - array('https', null, null, 'http', 8080, ""), - array('https', null, 8443, 'http', 8080, ":8443"), - array('https', null, 443, 'http', 8080, ""), + array('http', null, null, 'http', 8080, ':8080'), + array('http', 4080, null, 'http', 8080, ':4080'), + array('http', 80, null, 'http', 8080, ''), + array('https', null, null, 'http', 8080, ''), + array('https', null, 8443, 'http', 8080, ':8443'), + array('https', null, 443, 'http', 8080, ''), - array('https', null, null, 'https', 8443, ":8443"), - array('https', null, 4443, 'https', 8443, ":4443"), - array('https', null, 443, 'https', 8443, ""), - array('http', null, null, 'https', 8443, ""), - array('http', 8080, 4443, 'https', 8443, ":8080"), - array('http', 80, 4443, 'https', 8443, ""), + array('https', null, null, 'https', 8443, ':8443'), + array('https', null, 4443, 'https', 8443, ':4443'), + array('https', null, 443, 'https', 8443, ''), + array('http', null, null, 'https', 8443, ''), + array('http', 8080, 4443, 'https', 8443, ':8080'), + array('http', 80, 4443, 'https', 8443, ''), ); } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php index c326da95bb..67d57e9254 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php @@ -273,7 +273,7 @@ abstract class FrameworkExtensionTest extends TestCase public function testValidationPaths() { - require_once __DIR__."/Fixtures/TestBundle/TestBundle.php"; + require_once __DIR__.'/Fixtures/TestBundle/TestBundle.php'; $container = $this->createContainerFromFile('validation_annotations', array( 'kernel.bundles' => array('TestBundle' => 'Symfony\Bundle\FrameworkBundle\Tests\TestBundle'), diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperDivLayoutTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperDivLayoutTest.php index df08b4e95d..7d71a1e1c3 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperDivLayoutTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperDivLayoutTest.php @@ -65,7 +65,7 @@ class FormHelperDivLayoutTest extends AbstractDivLayoutTest protected function renderEnctype(FormView $view) { if (!method_exists($form = $this->engine->get('form'), 'enctype')) { - $this->markTestSkipped(sprintf("Deprecated method %s->enctype() is not implemented.", get_class($form))); + $this->markTestSkipped(sprintf('Deprecated method %s->enctype() is not implemented.', get_class($form))); } return (string) $form->enctype($view); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperTableLayoutTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperTableLayoutTest.php index 6ebd379ecc..9d5ee6a8b9 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperTableLayoutTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperTableLayoutTest.php @@ -66,7 +66,7 @@ class FormHelperTableLayoutTest extends AbstractTableLayoutTest protected function renderEnctype(FormView $view) { if (!method_exists($form = $this->engine->get('form'), 'enctype')) { - $this->markTestSkipped(sprintf("Deprecated method %s->enctype() is not implemented.", get_class($form))); + $this->markTestSkipped(sprintf('Deprecated method %s->enctype() is not implemented.', get_class($form))); } return (string) $form->enctype($view); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/PhpExtractorTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/PhpExtractorTest.php index 52e20b874e..135c796354 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/PhpExtractorTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/PhpExtractorTest.php @@ -42,8 +42,8 @@ EOF; "double-quoted key with whitespace and escaped \$\n\" sequences" => "prefixdouble-quoted key with whitespace and escaped \$\n\" sequences", 'single-quoted key with whitespace and nonescaped \$\n\' sequences' => 'prefixsingle-quoted key with whitespace and nonescaped \$\n\' sequences', 'single-quoted key with "quote mark at the end"' => 'prefixsingle-quoted key with "quote mark at the end"', - $expectedHeredoc => "prefix".$expectedHeredoc, - $expectedNowdoc => "prefix".$expectedNowdoc, + $expectedHeredoc => 'prefix'.$expectedHeredoc, + $expectedNowdoc => 'prefix'.$expectedNowdoc, '{0} There is no apples|{1} There is one apple|]1,Inf[ There are %count% apples' => 'prefix{0} There is no apples|{1} There is one apple|]1,Inf[ There are %count% apples', )); $actualCatalogue = $catalogue->all(); diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityRoutingIntegrationTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityRoutingIntegrationTest.php index 8b879ce278..8239f99ea9 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityRoutingIntegrationTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityRoutingIntegrationTest.php @@ -69,8 +69,8 @@ class SecurityRoutingIntegrationTest extends WebTestCase */ public function testSecurityConfigurationForSingleIPAddress($config) { - $allowedClient = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array("REMOTE_ADDR" => "10.10.10.10")); - $barredClient = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array("REMOTE_ADDR" => "10.10.20.10")); + $allowedClient = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array('REMOTE_ADDR' => '10.10.10.10')); + $barredClient = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array('REMOTE_ADDR' => '10.10.20.10')); $this->assertAllowed($allowedClient, '/secured-by-one-ip'); $this->assertRestricted($barredClient, '/secured-by-one-ip'); @@ -82,9 +82,9 @@ class SecurityRoutingIntegrationTest extends WebTestCase */ public function testSecurityConfigurationForMultipleIPAddresses($config) { - $allowedClientA = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array("REMOTE_ADDR" => "1.1.1.1")); - $allowedClientB = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array("REMOTE_ADDR" => "2.2.2.2")); - $barredClient = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array("REMOTE_ADDR" => "192.168.1.1")); + $allowedClientA = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array('REMOTE_ADDR' => '1.1.1.1')); + $allowedClientB = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array('REMOTE_ADDR' => '2.2.2.2')); + $barredClient = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array('REMOTE_ADDR' => '192.168.1.1')); $this->assertAllowed($allowedClientA, '/secured-by-two-ips'); $this->assertAllowed($allowedClientB, '/secured-by-two-ips'); diff --git a/src/Symfony/Bundle/TwigBundle/Command/LintCommand.php b/src/Symfony/Bundle/TwigBundle/Command/LintCommand.php index 01e81aef56..308d53b54e 100644 --- a/src/Symfony/Bundle/TwigBundle/Command/LintCommand.php +++ b/src/Symfony/Bundle/TwigBundle/Command/LintCommand.php @@ -63,7 +63,7 @@ EOF if (!$filename) { if (0 !== ftell(STDIN)) { - throw new \RuntimeException("Please provide a filename or pipe template content to stdin."); + throw new \RuntimeException('Please provide a filename or pipe template content to stdin.'); } while (!feof(STDIN)) { @@ -114,14 +114,14 @@ EOF $lines = $this->getContext($template, $line); if ($file) { - $output->writeln(sprintf("KO in %s (line %s)", $file, $line)); + $output->writeln(sprintf('KO in %s (line %s)', $file, $line)); } else { - $output->writeln(sprintf("KO (line %s)", $line)); + $output->writeln(sprintf('KO (line %s)', $line)); } foreach ($lines as $no => $code) { $output->writeln(sprintf( - "%s %-6s %s", + '%s %-6s %s', $no == $line ? '>>' : ' ', $no, $code diff --git a/src/Symfony/Component/Config/Definition/ReferenceDumper.php b/src/Symfony/Component/Config/Definition/ReferenceDumper.php index 2287284266..9bbfd4b1d8 100644 --- a/src/Symfony/Component/Config/Definition/ReferenceDumper.php +++ b/src/Symfony/Component/Config/Definition/ReferenceDumper.php @@ -120,7 +120,7 @@ class ReferenceDumper if ($info = $node->getInfo()) { $this->writeLine(''); // indenting multi-line info - $info = str_replace("\n", sprintf("\n%".($depth * 4)."s# ", ' '), $info); + $info = str_replace("\n", sprintf("\n%".($depth * 4).'s# ', ' '), $info); $this->writeLine('# '.$info, $depth * 4); } diff --git a/src/Symfony/Component/Config/Exception/FileLoaderLoadException.php b/src/Symfony/Component/Config/Exception/FileLoaderLoadException.php index d05cf8f89f..b2a567ecda 100644 --- a/src/Symfony/Component/Config/Exception/FileLoaderLoadException.php +++ b/src/Symfony/Component/Config/Exception/FileLoaderLoadException.php @@ -57,7 +57,7 @@ class FileLoaderLoadException extends \Exception $a[] = sprintf('%s => %s', $k, $this->varToString($v)); } - return sprintf("Array(%s)", implode(', ', $a)); + return sprintf('Array(%s)', implode(', ', $a)); } if (is_resource($var)) { diff --git a/src/Symfony/Component/Config/Tests/Fixtures/Configuration/ExampleConfiguration.php b/src/Symfony/Component/Config/Tests/Fixtures/Configuration/ExampleConfiguration.php index 7511dc6244..e2db39ea8b 100644 --- a/src/Symfony/Component/Config/Tests/Fixtures/Configuration/ExampleConfiguration.php +++ b/src/Symfony/Component/Config/Tests/Fixtures/Configuration/ExampleConfiguration.php @@ -41,7 +41,7 @@ class ExampleConfiguration implements ConfigurationInterface ->info( "this is a long\n". "multi-line info text\n". - "which should be indented" + 'which should be indented' ) ->example('example setting') ->end() diff --git a/src/Symfony/Component/Console/Application.php b/src/Symfony/Component/Console/Application.php index 6222fbd22a..fa14441421 100644 --- a/src/Symfony/Component/Console/Application.php +++ b/src/Symfony/Component/Console/Application.php @@ -769,15 +769,15 @@ class Application $output->writeln(sprintf(' %s%s%s() at %s:%s', $class, $type, $function, $file, $line)); } - $output->writeln(""); - $output->writeln(""); + $output->writeln(''); + $output->writeln(''); } } while ($e = $e->getPrevious()); if (null !== $this->runningCommand) { $output->writeln(sprintf('%s', sprintf($this->runningCommand->getSynopsis(), $this->getName()))); - $output->writeln(""); - $output->writeln(""); + $output->writeln(''); + $output->writeln(''); } } diff --git a/src/Symfony/Component/Console/Helper/DialogHelper.php b/src/Symfony/Component/Console/Helper/DialogHelper.php index 3f31c430ca..7c00cb82f5 100644 --- a/src/Symfony/Component/Console/Helper/DialogHelper.php +++ b/src/Symfony/Component/Console/Helper/DialogHelper.php @@ -53,14 +53,14 @@ class DialogHelper extends Helper $result = $this->askAndValidate($output, '> ', function ($picked) use ($choices, $errorMessage, $multiselect) { // Collapse all spaces. - $selectedChoices = str_replace(" ", "", $picked); + $selectedChoices = str_replace(' ', '', $picked); if ($multiselect) { // Check for a separated comma values if (!preg_match('/^[a-zA-Z0-9_-]+(?:,[a-zA-Z0-9_-]+)*$/', $selectedChoices, $matches)) { throw new \InvalidArgumentException(sprintf($errorMessage, $picked)); } - $selectedChoices = explode(",", $selectedChoices); + $selectedChoices = explode(',', $selectedChoices); } else { $selectedChoices = array($picked); } diff --git a/src/Symfony/Component/Console/Tests/Fixtures/Foo3Command.php b/src/Symfony/Component/Console/Tests/Fixtures/Foo3Command.php index 43a35076e3..6c890fafff 100644 --- a/src/Symfony/Component/Console/Tests/Fixtures/Foo3Command.php +++ b/src/Symfony/Component/Console/Tests/Fixtures/Foo3Command.php @@ -18,12 +18,12 @@ class Foo3Command extends Command { try { try { - throw new \Exception("First exception

this is html

"); + throw new \Exception('First exception

this is html

'); } catch (\Exception $e) { - throw new \Exception("Second exception comment", 0, $e); + throw new \Exception('Second exception comment', 0, $e); } } catch (\Exception $e) { - throw new \Exception("Third exception comment", 0, $e); + throw new \Exception('Third exception comment', 0, $e); } } } diff --git a/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php b/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php index 6f1e16da43..9856760c11 100644 --- a/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php +++ b/src/Symfony/Component/Console/Tests/Formatter/OutputFormatterTest.php @@ -19,15 +19,15 @@ class OutputFormatterTest extends \PHPUnit_Framework_TestCase public function testEmptyTag() { $formatter = new OutputFormatter(true); - $this->assertEquals("foo<>bar", $formatter->format('foo<>bar')); + $this->assertEquals('foo<>bar', $formatter->format('foo<>bar')); } public function testLGCharEscaping() { $formatter = new OutputFormatter(true); - $this->assertEquals("fooformat('foo\\assertEquals("some info", $formatter->format('\\some info\\')); + $this->assertEquals('fooformat('foo\\assertEquals('some info', $formatter->format('\\some info\\')); $this->assertEquals("\\some info\\", OutputFormatter::escape('some info')); $this->assertEquals( @@ -176,16 +176,16 @@ class OutputFormatterTest extends \PHPUnit_Framework_TestCase $this->assertTrue($formatter->hasStyle('question')); $this->assertEquals( - "some error", $formatter->format('some error') + 'some error', $formatter->format('some error') ); $this->assertEquals( - "some info", $formatter->format('some info') + 'some info', $formatter->format('some info') ); $this->assertEquals( - "some comment", $formatter->format('some comment') + 'some comment', $formatter->format('some comment') ); $this->assertEquals( - "some question", $formatter->format('some question') + 'some question', $formatter->format('some question') ); $formatter->setDecorated(true); diff --git a/src/Symfony/Component/Console/Tests/Helper/TableHelperTest.php b/src/Symfony/Component/Console/Tests/Helper/TableHelperTest.php index cd9e0f469d..e0d83cec61 100644 --- a/src/Symfony/Component/Console/Tests/Helper/TableHelperTest.php +++ b/src/Symfony/Component/Console/Tests/Helper/TableHelperTest.php @@ -157,10 +157,10 @@ TABLE array( array('ISBN', 'Title', 'Author'), array( - array("99921-58-10-7", "Divine\nComedy", "Dante Alighieri"), - array("9971-5-0210-2", "Harry Potter\nand the Chamber of Secrets", "Rowling\nJoanne K."), - array("9971-5-0210-2", "Harry Potter\nand the Chamber of Secrets", "Rowling\nJoanne K."), - array("960-425-059-0", "The Lord of the Rings", "J. R. R.\nTolkien"), + array('99921-58-10-7', "Divine\nComedy", 'Dante Alighieri'), + array('9971-5-0210-2', "Harry Potter\nand the Chamber of Secrets", "Rowling\nJoanne K."), + array('9971-5-0210-2', "Harry Potter\nand the Chamber of Secrets", "Rowling\nJoanne K."), + array('960-425-059-0', 'The Lord of the Rings', "J. R. R.\nTolkien"), ), TableHelper::LAYOUT_DEFAULT, <<tokenize() parses long options with a value'), array('--long-option="foo bar""another"', array('--long-option=foo baranother'), '->tokenize() parses long options with a value'), array('--long-option=\'foo bar\'', array('--long-option=foo bar'), '->tokenize() parses long options with a value'), - array("--long-option='foo bar''another'", array("--long-option=foo baranother"), '->tokenize() parses long options with a value'), - array("--long-option='foo bar'\"another\"", array("--long-option=foo baranother"), '->tokenize() parses long options with a value'), + array("--long-option='foo bar''another'", array('--long-option=foo baranother'), '->tokenize() parses long options with a value'), + array("--long-option='foo bar'\"another\"", array('--long-option=foo baranother'), '->tokenize() parses long options with a value'), array('foo -a -ffoo --long bar', array('foo', '-a', '-ffoo', '--long', 'bar'), '->tokenize() parses when several arguments and options'), ); } diff --git a/src/Symfony/Component/CssSelector/Tests/CssSelectorTest.php b/src/Symfony/Component/CssSelector/Tests/CssSelectorTest.php index 50daeccd1d..61ab80eec8 100644 --- a/src/Symfony/Component/CssSelector/Tests/CssSelectorTest.php +++ b/src/Symfony/Component/CssSelector/Tests/CssSelectorTest.php @@ -37,23 +37,23 @@ class CssSelectorTest extends \PHPUnit_Framework_TestCase $this->fail('->parse() throws an Exception if the css selector is not valid'); } catch (\Exception $e) { $this->assertInstanceOf('\Symfony\Component\CssSelector\Exception\ParseException', $e, '->parse() throws an Exception if the css selector is not valid'); - $this->assertEquals("Expected identifier, but found.", $e->getMessage(), '->parse() throws an Exception if the css selector is not valid'); + $this->assertEquals('Expected identifier, but found.', $e->getMessage(), '->parse() throws an Exception if the css selector is not valid'); } } public function getCssToXPathWithoutPrefixTestData() { return array( - array('h1', "h1"), - array('foo|h1', "foo:h1"), - array('h1, h2, h3', "h1 | h2 | h3"), + array('h1', 'h1'), + array('foo|h1', 'foo:h1'), + array('h1, h2, h3', 'h1 | h2 | h3'), array('h1:nth-child(3n+1)', "*/*[name() = 'h1' and (position() - 1 >= 0 and (position() - 1) mod 3 = 0)]"), - array('h1 > p', "h1/p"), + array('h1 > p', 'h1/p'), array('h1#foo', "h1[@id = 'foo']"), array('h1.foo', "h1[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"), array('h1[class*="foo bar"]', "h1[@class and contains(@class, 'foo bar')]"), array('h1[foo|class*="foo bar"]', "h1[@foo:class and contains(@foo:class, 'foo bar')]"), - array('h1[class]', "h1[@class]"), + array('h1[class]', 'h1[@class]'), array('h1 .foo', "h1/descendant-or-self::*/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]"), array('h1 #foo', "h1/descendant-or-self::*/*[@id = 'foo']"), array('h1 [class*=foo]', "h1/descendant-or-self::*/*[@class and contains(@class, 'foo')]"), diff --git a/src/Symfony/Component/CssSelector/Tests/XPath/TranslatorTest.php b/src/Symfony/Component/CssSelector/Tests/XPath/TranslatorTest.php index 30f7189f06..143328f412 100644 --- a/src/Symfony/Component/CssSelector/Tests/XPath/TranslatorTest.php +++ b/src/Symfony/Component/CssSelector/Tests/XPath/TranslatorTest.php @@ -90,12 +90,12 @@ class TranslatorTest extends \PHPUnit_Framework_TestCase public function getCssToXPathTestData() { return array( - array('*', "*"), - array('e', "e"), - array('*|e', "e"), - array('e|f', "e:f"), - array('e[foo]', "e[@foo]"), - array('e[foo|bar]', "e[@foo:bar]"), + array('*', '*'), + array('e', 'e'), + array('*|e', 'e'), + array('e|f', 'e:f'), + array('e[foo]', 'e[@foo]'), + array('e[foo|bar]', 'e[@foo:bar]'), array('e[foo="bar"]', "e[@foo = 'bar']"), array('e[foo~="bar"]', "e[@foo and contains(concat(' ', normalize-space(@foo), ' '), ' bar ')]"), array('e[foo^="bar"]', "e[@foo and starts-with(@foo, 'bar')]"), @@ -105,29 +105,29 @@ class TranslatorTest extends \PHPUnit_Framework_TestCase array('e:nth-child(1)', "*/*[name() = 'e' and (position() = 1)]"), array('e:nth-last-child(1)', "*/*[name() = 'e' and (position() = last() - 0)]"), array('e:nth-last-child(2n+2)', "*/*[name() = 'e' and (last() - position() - 1 >= 0 and (last() - position() - 1) mod 2 = 0)]"), - array('e:nth-of-type(1)', "*/e[position() = 1]"), - array('e:nth-last-of-type(1)', "*/e[position() = last() - 0]"), + array('e:nth-of-type(1)', '*/e[position() = 1]'), + array('e:nth-last-of-type(1)', '*/e[position() = last() - 0]'), array('div e:nth-last-of-type(1) .aclass', "div/descendant-or-self::*/e[position() = last() - 0]/descendant-or-self::*/*[@class and contains(concat(' ', normalize-space(@class), ' '), ' aclass ')]"), array('e:first-child', "*/*[name() = 'e' and (position() = 1)]"), array('e:last-child', "*/*[name() = 'e' and (position() = last())]"), - array('e:first-of-type', "*/e[position() = 1]"), - array('e:last-of-type', "*/e[position() = last()]"), + array('e:first-of-type', '*/e[position() = 1]'), + array('e:last-of-type', '*/e[position() = last()]'), array('e:only-child', "*/*[name() = 'e' and (last() = 1)]"), - array('e:only-of-type', "e[last() = 1]"), - array('e:empty', "e[not(*) and not(string-length())]"), - array('e:EmPTY', "e[not(*) and not(string-length())]"), - array('e:root', "e[not(parent::*)]"), - array('e:hover', "e[0]"), + array('e:only-of-type', 'e[last() = 1]'), + array('e:empty', 'e[not(*) and not(string-length())]'), + array('e:EmPTY', 'e[not(*) and not(string-length())]'), + array('e:root', 'e[not(parent::*)]'), + array('e:hover', 'e[0]'), array('e:contains("foo")', "e[contains(string(.), 'foo')]"), array('e:ConTains(foo)', "e[contains(string(.), 'foo')]"), array('e.warning', "e[@class and contains(concat(' ', normalize-space(@class), ' '), ' warning ')]"), array('e#myid', "e[@id = 'myid']"), - array('e:not(:nth-child(odd))', "e[not(position() - 1 >= 0 and (position() - 1) mod 2 = 0)]"), - array('e:nOT(*)', "e[0]"), - array('e f', "e/descendant-or-self::*/f"), - array('e > f', "e/f"), + array('e:not(:nth-child(odd))', 'e[not(position() - 1 >= 0 and (position() - 1) mod 2 = 0)]'), + array('e:nOT(*)', 'e[0]'), + array('e f', 'e/descendant-or-self::*/f'), + array('e > f', 'e/f'), array('e + f', "e/following-sibling::*[name() = 'f' and (position() = 1)]"), - array('e ~ f', "e/following-sibling::f"), + array('e ~ f', 'e/following-sibling::f'), array('div#container p', "div[@id = 'container']/descendant-or-self::*/p"), ); } diff --git a/src/Symfony/Component/CssSelector/XPath/Extension/HtmlExtension.php b/src/Symfony/Component/CssSelector/XPath/Extension/HtmlExtension.php index 883156be70..0da74d4727 100644 --- a/src/Symfony/Component/CssSelector/XPath/Extension/HtmlExtension.php +++ b/src/Symfony/Component/CssSelector/XPath/Extension/HtmlExtension.php @@ -98,9 +98,9 @@ class HtmlExtension extends AbstractExtension public function translateDisabled(XPathExpr $xpath) { return $xpath->addCondition( - "(" - ."@disabled and" - ."(" + '(' + .'@disabled and' + .'(' ."(name(.) = 'input' and @type != 'hidden')" ." or name(.) = 'button'" ." or name(.) = 'select'" @@ -109,14 +109,14 @@ class HtmlExtension extends AbstractExtension ." or name(.) = 'fieldset'" ." or name(.) = 'optgroup'" ." or name(.) = 'option'" - .")" - .") or (" + .')' + .') or (' ."(name(.) = 'input' and @type != 'hidden')" ." or name(.) = 'button'" ." or name(.) = 'select'" ." or name(.) = 'textarea'" - .")" - ." and ancestor::fieldset[@disabled]" + .')' + .' and ancestor::fieldset[@disabled]' ); // todo: in the second half, add "and is not a descendant of that fieldset element's first legend element child, if any." } @@ -150,10 +150,10 @@ class HtmlExtension extends AbstractExtension ." or name(.) = 'textarea'" ." or name(.) = 'keygen'" .')' - ." and not (@disabled or ancestor::fieldset[@disabled])" + .' and not (@disabled or ancestor::fieldset[@disabled])' .') or (' ."name(.) = 'option' and not(" - ."@disabled or ancestor::optgroup[@disabled]" + .'@disabled or ancestor::optgroup[@disabled]' .')' .')' ); diff --git a/src/Symfony/Component/Debug/ExceptionHandler.php b/src/Symfony/Component/Debug/ExceptionHandler.php index 042f3e7239..6d55d8afa3 100644 --- a/src/Symfony/Component/Debug/ExceptionHandler.php +++ b/src/Symfony/Component/Debug/ExceptionHandler.php @@ -298,9 +298,9 @@ EOF; $result = array(); foreach ($args as $key => $item) { if ('object' === $item[0]) { - $formattedValue = sprintf("object(%s)", $this->abbrClass($item[1])); + $formattedValue = sprintf('object(%s)', $this->abbrClass($item[1])); } elseif ('array' === $item[0]) { - $formattedValue = sprintf("array(%s)", is_array($item[1]) ? $this->formatArgs($item[1]) : $item[1]); + $formattedValue = sprintf('array(%s)', is_array($item[1]) ? $this->formatArgs($item[1]) : $item[1]); } elseif ('string' === $item[0]) { $formattedValue = sprintf("'%s'", htmlspecialchars($item[1], $flags, $this->charset)); } elseif ('null' === $item[0]) { diff --git a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php index 009f591a87..e8bc744ed9 100644 --- a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php +++ b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php @@ -539,7 +539,7 @@ class PhpDumper extends Dumper if ($definition->isSynthetic()) { $return[] = '@throws RuntimeException always since this service is expected to be injected dynamically'; } elseif ($class = $definition->getClass()) { - $return[] = sprintf("@return %s A %s instance.", 0 === strpos($class, '%') ? 'object' : "\\".$class, $class); + $return[] = sprintf('@return %s A %s instance.', 0 === strpos($class, '%') ? 'object' : "\\".$class, $class); } elseif ($definition->getFactoryClass()) { $return[] = sprintf('@return object An instance returned by %s::%s().', $definition->getFactoryClass(), $definition->getFactoryMethod()); } elseif ($definition->getFactoryService()) { @@ -1225,7 +1225,7 @@ EOF; } elseif (null !== $value->getFactoryService()) { $service = $this->dumpValue($value->getFactoryService()); - return sprintf("%s->%s(%s)", 0 === strpos($service, '$') ? sprintf('$this->get(%s)', $service) : $this->getServiceCall($value->getFactoryService()), $value->getFactoryMethod(), implode(', ', $arguments)); + return sprintf('%s->%s(%s)', 0 === strpos($service, '$') ? sprintf('$this->get(%s)', $service) : $this->getServiceCall($value->getFactoryService()), $value->getFactoryMethod(), implode(', ', $arguments)); } else { throw new RuntimeException('Cannot dump definitions which have factory method without factory service or factory class.'); } diff --git a/src/Symfony/Component/DependencyInjection/Tests/DefinitionTest.php b/src/Symfony/Component/DependencyInjection/Tests/DefinitionTest.php index 4ffd7c0792..4fcef3828d 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/DefinitionTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/DefinitionTest.php @@ -31,8 +31,8 @@ class DefinitionTest extends \PHPUnit_Framework_TestCase { $def = new Definition('stdClass'); $this->assertNull($def->getFactoryClass()); - $this->assertSame($def, $def->setFactoryClass('stdClass2'), "->setFactoryClass() implements a fluent interface."); - $this->assertEquals('stdClass2', $def->getFactoryClass(), "->getFactoryClass() returns current class to construct this service."); + $this->assertSame($def, $def->setFactoryClass('stdClass2'), '->setFactoryClass() implements a fluent interface.'); + $this->assertEquals('stdClass2', $def->getFactoryClass(), '->getFactoryClass() returns current class to construct this service.'); } public function testSetGetFactoryMethod() @@ -47,8 +47,8 @@ class DefinitionTest extends \PHPUnit_Framework_TestCase { $def = new Definition('stdClass'); $this->assertNull($def->getFactoryService()); - $this->assertSame($def, $def->setFactoryService('foo.bar'), "->setFactoryService() implements a fluent interface."); - $this->assertEquals('foo.bar', $def->getFactoryService(), "->getFactoryService() returns current service to construct this service."); + $this->assertSame($def, $def->setFactoryService('foo.bar'), '->setFactoryService() implements a fluent interface.'); + $this->assertEquals('foo.bar', $def->getFactoryService(), '->getFactoryService() returns current service to construct this service.'); } /** diff --git a/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php b/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php index 86c2b72ba2..c993e40104 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php @@ -63,8 +63,8 @@ class PhpDumperTest extends \PHPUnit_Framework_TestCase '.' => 'dot as a key', '.\'\'.' => 'concatenation as a key', '\'\'.' => 'concatenation from the start key', - 'optimize concatenation' => "string1%some_string%string2", - 'optimize concatenation with empty string' => "string1%empty_value%string2", + 'optimize concatenation' => 'string1%some_string%string2', + 'optimize concatenation with empty string' => 'string1%empty_value%string2', 'optimize concatenation from the start' => '%empty_value%start', 'optimize concatenation at the end' => 'end%empty_value%', )); diff --git a/src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php b/src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php index 549d52d3a4..4a10654bb7 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php @@ -210,31 +210,31 @@ class XmlFileLoaderTest extends \PHPUnit_Framework_TestCase public function testConvertDomElementToArray() { - $doc = new \DOMDocument("1.0"); + $doc = new \DOMDocument('1.0'); $doc->loadXML('bar'); $this->assertEquals('bar', XmlFileLoader::convertDomElementToArray($doc->documentElement), '::convertDomElementToArray() converts a \DomElement to an array'); - $doc = new \DOMDocument("1.0"); + $doc = new \DOMDocument('1.0'); $doc->loadXML(''); $this->assertEquals(array('foo' => 'bar'), XmlFileLoader::convertDomElementToArray($doc->documentElement), '::convertDomElementToArray() converts a \DomElement to an array'); - $doc = new \DOMDocument("1.0"); + $doc = new \DOMDocument('1.0'); $doc->loadXML('bar'); $this->assertEquals(array('foo' => 'bar'), XmlFileLoader::convertDomElementToArray($doc->documentElement), '::convertDomElementToArray() converts a \DomElement to an array'); - $doc = new \DOMDocument("1.0"); + $doc = new \DOMDocument('1.0'); $doc->loadXML('barbar'); $this->assertEquals(array('foo' => array('value' => 'bar', 'foo' => 'bar')), XmlFileLoader::convertDomElementToArray($doc->documentElement), '::convertDomElementToArray() converts a \DomElement to an array'); - $doc = new \DOMDocument("1.0"); + $doc = new \DOMDocument('1.0'); $doc->loadXML(''); $this->assertEquals(array('foo' => null), XmlFileLoader::convertDomElementToArray($doc->documentElement), '::convertDomElementToArray() converts a \DomElement to an array'); - $doc = new \DOMDocument("1.0"); + $doc = new \DOMDocument('1.0'); $doc->loadXML(''); $this->assertEquals(array('foo' => null), XmlFileLoader::convertDomElementToArray($doc->documentElement), '::convertDomElementToArray() converts a \DomElement to an array'); - $doc = new \DOMDocument("1.0"); + $doc = new \DOMDocument('1.0'); $doc->loadXML(''); $this->assertEquals(array('foo' => array(array('foo' => 'bar'), array('foo' => 'bar'))), XmlFileLoader::convertDomElementToArray($doc->documentElement), '::convertDomElementToArray() converts a \DomElement to an array'); } diff --git a/src/Symfony/Component/DomCrawler/Crawler.php b/src/Symfony/Component/DomCrawler/Crawler.php index 7fe313e118..ebe89c0ded 100644 --- a/src/Symfony/Component/DomCrawler/Crawler.php +++ b/src/Symfony/Component/DomCrawler/Crawler.php @@ -785,7 +785,7 @@ class Crawler extends \SplObjectStorage } } - return sprintf("concat(%s)", implode($parts, ', ')); + return sprintf('concat(%s)', implode($parts, ', ')); } /** diff --git a/src/Symfony/Component/DomCrawler/FormFieldRegistry.php b/src/Symfony/Component/DomCrawler/FormFieldRegistry.php index 95dc878d5f..27f93c94de 100644 --- a/src/Symfony/Component/DomCrawler/FormFieldRegistry.php +++ b/src/Symfony/Component/DomCrawler/FormFieldRegistry.php @@ -176,7 +176,7 @@ class FormFieldRegistry private function walk(array $array, $base = '', array &$output = array()) { foreach ($array as $k => $v) { - $path = empty($base) ? $k : sprintf("%s[%s]", $base, $k); + $path = empty($base) ? $k : sprintf('%s[%s]', $base, $k); if (is_array($v)) { $this->walk($v, $path, $output); } else { diff --git a/src/Symfony/Component/DomCrawler/Tests/FormTest.php b/src/Symfony/Component/DomCrawler/Tests/FormTest.php index 1712dc2471..511de86095 100644 --- a/src/Symfony/Component/DomCrawler/Tests/FormTest.php +++ b/src/Symfony/Component/DomCrawler/Tests/FormTest.php @@ -397,7 +397,7 @@ class FormTest extends \PHPUnit_Framework_TestCase public function testMultiselectSetValues() { $form = $this->createForm('
'); - $form->setValues(array('multi' => array("foo", "bar"))); + $form->setValues(array('multi' => array('foo', 'bar'))); $this->assertEquals(array('multi' => array('foo', 'bar')), $form->getValues(), '->setValue() sets the values of select'); } diff --git a/src/Symfony/Component/Finder/Tests/FinderTest.php b/src/Symfony/Component/Finder/Tests/FinderTest.php index c2cb3d9930..67625e9681 100644 --- a/src/Symfony/Component/Finder/Tests/FinderTest.php +++ b/src/Symfony/Component/Finder/Tests/FinderTest.php @@ -381,7 +381,7 @@ class FinderTest extends Iterator\RealIteratorTestCase $paths[] = $file->getRelativePath(); } - $ref = array("", "", "", "", "foo", ""); + $ref = array('', '', '', '', 'foo', ''); sort($ref); sort($paths); @@ -402,7 +402,7 @@ class FinderTest extends Iterator\RealIteratorTestCase $paths[] = $file->getRelativePathname(); } - $ref = array("test.php", "toto", "test.py", "foo", "foo".DIRECTORY_SEPARATOR."bar.tmp", "foo bar"); + $ref = array('test.php', 'toto', 'test.py', 'foo', 'foo'.DIRECTORY_SEPARATOR.'bar.tmp', 'foo bar'); sort($paths); sort($ref); diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/FixUrlProtocolListenerTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/FixUrlProtocolListenerTest.php index 475681a053..a971ea215c 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/FixUrlProtocolListenerTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/FixUrlProtocolListenerTest.php @@ -18,7 +18,7 @@ class FixUrlProtocolListenerTest extends \PHPUnit_Framework_TestCase { public function testFixHttpUrl() { - $data = "www.symfony.com"; + $data = 'www.symfony.com'; $form = $this->getMock('Symfony\Component\Form\Test\FormInterface'); $event = new FormEvent($form, $data); @@ -30,7 +30,7 @@ class FixUrlProtocolListenerTest extends \PHPUnit_Framework_TestCase public function testSkipKnownUrl() { - $data = "http://www.symfony.com"; + $data = 'http://www.symfony.com'; $form = $this->getMock('Symfony\Component\Form\Test\FormInterface'); $event = new FormEvent($form, $data); @@ -42,7 +42,7 @@ class FixUrlProtocolListenerTest extends \PHPUnit_Framework_TestCase public function testSkipOtherProtocol() { - $data = "ftp://www.symfony.com"; + $data = 'ftp://www.symfony.com'; $form = $this->getMock('Symfony\Component\Form\Test\FormInterface'); $event = new FormEvent($form, $data); diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/TrimListenerTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/TrimListenerTest.php index 38b39ac11c..3818c7861f 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/TrimListenerTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/EventListener/TrimListenerTest.php @@ -18,7 +18,7 @@ class TrimListenerTest extends \PHPUnit_Framework_TestCase { public function testTrim() { - $data = " Foo! "; + $data = ' Foo! '; $form = $this->getMock('Symfony\Component\Form\Test\FormInterface'); $event = new FormEvent($form, $data); diff --git a/src/Symfony/Component/Form/Tests/Extension/Csrf/EventListener/CsrfValidationListenerTest.php b/src/Symfony/Component/Form/Tests/Extension/Csrf/EventListener/CsrfValidationListenerTest.php index 7f2220af72..646c385c15 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Csrf/EventListener/CsrfValidationListenerTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Csrf/EventListener/CsrfValidationListenerTest.php @@ -62,7 +62,7 @@ class CsrfValidationListenerTest extends \PHPUnit_Framework_TestCase // https://github.com/symfony/symfony/pull/5838 public function testStringFormData() { - $data = "XP4HUzmHPi"; + $data = 'XP4HUzmHPi'; $event = new FormEvent($this->form, $data); $validation = new CsrfValidationListener('csrf', $this->csrfProvider, 'unknown', 'Invalid.'); diff --git a/src/Symfony/Component/HttpFoundation/Cookie.php b/src/Symfony/Component/HttpFoundation/Cookie.php index 44b7792ef2..466d020435 100644 --- a/src/Symfony/Component/HttpFoundation/Cookie.php +++ b/src/Symfony/Component/HttpFoundation/Cookie.php @@ -84,12 +84,12 @@ class Cookie $str = urlencode($this->getName()).'='; if ('' === (string) $this->getValue()) { - $str .= 'deleted; expires='.gmdate("D, d-M-Y H:i:s T", time() - 31536001); + $str .= 'deleted; expires='.gmdate('D, d-M-Y H:i:s T', time() - 31536001); } else { $str .= urlencode($this->getValue()); if ($this->getExpiresTime() !== 0) { - $str .= '; expires='.gmdate("D, d-M-Y H:i:s T", $this->getExpiresTime()); + $str .= '; expires='.gmdate('D, d-M-Y H:i:s T', $this->getExpiresTime()); } } diff --git a/src/Symfony/Component/HttpFoundation/IpUtils.php b/src/Symfony/Component/HttpFoundation/IpUtils.php index aaa1647556..796136798d 100644 --- a/src/Symfony/Component/HttpFoundation/IpUtils.php +++ b/src/Symfony/Component/HttpFoundation/IpUtils.php @@ -107,8 +107,8 @@ class IpUtils $netmask = 128; } - $bytesAddr = unpack("n*", inet_pton($address)); - $bytesTest = unpack("n*", inet_pton($requestIp)); + $bytesAddr = unpack('n*', inet_pton($address)); + $bytesTest = unpack('n*', inet_pton($requestIp)); for ($i = 1, $ceil = ceil($netmask / 16); $i <= $ceil; $i++) { $left = $netmask - 16 * ($i-1); diff --git a/src/Symfony/Component/HttpFoundation/Response.php b/src/Symfony/Component/HttpFoundation/Response.php index 3db864db8a..841ea0c595 100644 --- a/src/Symfony/Component/HttpFoundation/Response.php +++ b/src/Symfony/Component/HttpFoundation/Response.php @@ -1195,7 +1195,7 @@ class Response protected function ensureIEOverSSLCompatibility(Request $request) { if (false !== stripos($this->headers->get('Content-Disposition'), 'attachment') && preg_match('/MSIE (.*?);/i', $request->server->get('HTTP_USER_AGENT'), $match) == 1 && true === $request->isSecure()) { - if ((int) preg_replace("/(MSIE )(.*?);/", "$2", $match[0]) < 9) { + if ((int) preg_replace('/(MSIE )(.*?);/', '$2', $match[0]) < 9) { $this->headers->remove('Cache-Control'); } } diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php b/src/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php index 2e5c0fedc7..96dae6b35c 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/MockArraySessionStorage.php @@ -159,7 +159,7 @@ class MockArraySessionStorage implements SessionStorageInterface public function save() { if (!$this->started || $this->closed) { - throw new \RuntimeException("Trying to save a session that was not started yet or was already closed"); + throw new \RuntimeException('Trying to save a session that was not started yet or was already closed'); } // nothing to do since we don't persist the session data $this->closed = false; diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/MockFileSessionStorage.php b/src/Symfony/Component/HttpFoundation/Session/Storage/MockFileSessionStorage.php index f1a699b697..1f4117b74e 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/MockFileSessionStorage.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/MockFileSessionStorage.php @@ -93,7 +93,7 @@ class MockFileSessionStorage extends MockArraySessionStorage public function save() { if (!$this->started) { - throw new \RuntimeException("Trying to save a session that was not started yet or was already closed"); + throw new \RuntimeException('Trying to save a session that was not started yet or was already closed'); } file_put_contents($this->getFilePath(), serialize($this->data)); diff --git a/src/Symfony/Component/HttpFoundation/Tests/CookieTest.php b/src/Symfony/Component/HttpFoundation/Tests/CookieTest.php index cfd238e070..0ec8e7bc99 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/CookieTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/CookieTest.php @@ -25,9 +25,9 @@ class CookieTest extends \PHPUnit_Framework_TestCase { return array( array(''), - array(",MyName"), - array(";MyName"), - array(" MyName"), + array(',MyName'), + array(';MyName'), + array(' MyName'), array("\tMyName"), array("\rMyName"), array("\nMyName"), @@ -89,7 +89,7 @@ class CookieTest extends \PHPUnit_Framework_TestCase public function testGetExpiresTimeWithStringValue() { - $value = "+1 day"; + $value = '+1 day'; $cookie = new Cookie('foo', 'bar', $value); $expire = strtotime($value); @@ -137,7 +137,7 @@ class CookieTest extends \PHPUnit_Framework_TestCase $this->assertEquals('foo=bar; expires=Fri, 20-May-2011 15:25:52 GMT; path=/; domain=.myfoodomain.com; secure; httponly', $cookie->__toString(), '->__toString() returns string representation of the cookie'); $cookie = new Cookie('foo', null, 1, '/admin/', '.myfoodomain.com'); - $this->assertEquals('foo=deleted; expires='.gmdate("D, d-M-Y H:i:s T", time()-31536001).'; path=/admin/; domain=.myfoodomain.com; httponly', $cookie->__toString(), '->__toString() returns string representation of a cleared cookie if value is NULL'); + $this->assertEquals('foo=deleted; expires='.gmdate('D, d-M-Y H:i:s T', time()-31536001).'; path=/admin/; domain=.myfoodomain.com; httponly', $cookie->__toString(), '->__toString() returns string representation of a cleared cookie if value is NULL'); $cookie = new Cookie('foo', 'bar', 0, '/', ''); $this->assertEquals('foo=bar; path=/; httponly', $cookie->__toString()); diff --git a/src/Symfony/Component/HttpFoundation/Tests/HeaderBagTest.php b/src/Symfony/Component/HttpFoundation/Tests/HeaderBagTest.php index 3ea9a57d21..9b925d70f0 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/HeaderBagTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/HeaderBagTest.php @@ -40,7 +40,7 @@ class HeaderBagTest extends \PHPUnit_Framework_TestCase { $bag = new HeaderBag(array('foo' => 'bar')); $keys = $bag->keys(); - $this->assertEquals("foo", $keys[0]); + $this->assertEquals('foo', $keys[0]); } public function testGetDate() diff --git a/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php b/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php index 3952f6712e..e8639d7be0 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php @@ -917,7 +917,7 @@ class RequestTest extends \PHPUnit_Framework_TestCase $req = new Request(); $retval = $req->getContent(true); $this->assertInternalType('resource', $retval); - $this->assertEquals("", fread($retval, 1)); + $this->assertEquals('', fread($retval, 1)); $this->assertTrue(feof($retval)); } diff --git a/src/Symfony/Component/HttpFoundation/Tests/ResponseHeaderBagTest.php b/src/Symfony/Component/HttpFoundation/Tests/ResponseHeaderBagTest.php index 1201deb903..8ff8662e99 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/ResponseHeaderBagTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/ResponseHeaderBagTest.php @@ -114,11 +114,11 @@ class ResponseHeaderBagTest extends \PHPUnit_Framework_TestCase $bag = new ResponseHeaderBag(array()); $bag->setCookie(new Cookie('foo', 'bar')); - $this->assertContains("Set-Cookie: foo=bar; path=/; httponly", explode("\r\n", $bag->__toString())); + $this->assertContains('Set-Cookie: foo=bar; path=/; httponly', explode("\r\n", $bag->__toString())); $bag->clearCookie('foo'); - $this->assertContains("Set-Cookie: foo=deleted; expires=".gmdate("D, d-M-Y H:i:s T", time() - 31536001)."; path=/; httponly", explode("\r\n", $bag->__toString())); + $this->assertContains('Set-Cookie: foo=deleted; expires='.gmdate('D, d-M-Y H:i:s T', time() - 31536001).'; path=/; httponly', explode("\r\n", $bag->__toString())); } public function testReplace() @@ -155,10 +155,10 @@ class ResponseHeaderBagTest extends \PHPUnit_Framework_TestCase $this->assertCount(4, $bag->getCookies()); $headers = explode("\r\n", $bag->__toString()); - $this->assertContains("Set-Cookie: foo=bar; path=/path/foo; domain=foo.bar; httponly", $headers); - $this->assertContains("Set-Cookie: foo=bar; path=/path/foo; domain=foo.bar; httponly", $headers); - $this->assertContains("Set-Cookie: foo=bar; path=/path/bar; domain=bar.foo; httponly", $headers); - $this->assertContains("Set-Cookie: foo=bar; path=/; httponly", $headers); + $this->assertContains('Set-Cookie: foo=bar; path=/path/foo; domain=foo.bar; httponly', $headers); + $this->assertContains('Set-Cookie: foo=bar; path=/path/foo; domain=foo.bar; httponly', $headers); + $this->assertContains('Set-Cookie: foo=bar; path=/path/bar; domain=bar.foo; httponly', $headers); + $this->assertContains('Set-Cookie: foo=bar; path=/; httponly', $headers); $cookies = $bag->getCookies(ResponseHeaderBag::COOKIES_ARRAY); $this->assertTrue(isset($cookies['foo.bar']['/path/foo']['foo'])); diff --git a/src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php b/src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php index a8a639082d..7dc3330912 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php @@ -29,8 +29,8 @@ class ResponseTest extends ResponseTestCase { $response = new Response(); $response = explode("\r\n", $response); - $this->assertEquals("HTTP/1.0 200 OK", $response[0]); - $this->assertEquals("Cache-Control: no-cache", $response[1]); + $this->assertEquals('HTTP/1.0 200 OK', $response[0]); + $this->assertEquals('Cache-Control: no-cache', $response[1]); } public function testClone() @@ -497,7 +497,7 @@ class ResponseTest extends ResponseTestCase $response = new Response(); //array('etag', 'last_modified', 'max_age', 's_maxage', 'private', 'public') try { - $response->setCache(array("wrong option" => "value")); + $response->setCache(array('wrong option' => 'value')); $this->fail('->setCache() throws an InvalidArgumentException if an option is not supported'); } catch (\Exception $e) { $this->assertInstanceOf('InvalidArgumentException', $e, '->setCache() throws an InvalidArgumentException if an option is not supported'); diff --git a/src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php index 3b4ae427d4..94e6541c91 100644 --- a/src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php +++ b/src/Symfony/Component/HttpKernel/DataCollector/DataCollector.php @@ -51,7 +51,7 @@ abstract class DataCollector implements DataCollectorInterface, \Serializable $a[] = sprintf('%s => %s', $k, $this->varToString($v)); } - return sprintf("Array(%s)", implode(', ', $a)); + return sprintf('Array(%s)', implode(', ', $a)); } if (is_resource($var)) { diff --git a/src/Symfony/Component/HttpKernel/Event/FilterControllerEvent.php b/src/Symfony/Component/HttpKernel/Event/FilterControllerEvent.php index a86bc9b362..e33a011752 100644 --- a/src/Symfony/Component/HttpKernel/Event/FilterControllerEvent.php +++ b/src/Symfony/Component/HttpKernel/Event/FilterControllerEvent.php @@ -86,7 +86,7 @@ class FilterControllerEvent extends KernelEvent $a[] = sprintf('%s => %s', $k, $this->varToString($v)); } - return sprintf("Array(%s)", implode(', ', $a)); + return sprintf('Array(%s)', implode(', ', $a)); } if (is_resource($var)) { diff --git a/src/Symfony/Component/HttpKernel/HttpKernel.php b/src/Symfony/Component/HttpKernel/HttpKernel.php index e624f4e863..00fbdbdedb 100644 --- a/src/Symfony/Component/HttpKernel/HttpKernel.php +++ b/src/Symfony/Component/HttpKernel/HttpKernel.php @@ -219,7 +219,7 @@ class HttpKernel implements HttpKernelInterface, TerminableInterface $a[] = sprintf('%s => %s', $k, $this->varToString($v)); } - return sprintf("Array(%s)", implode(', ', $a)); + return sprintf('Array(%s)', implode(', ', $a)); } if (is_resource($var)) { diff --git a/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php b/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php index a8d4f806af..87b8127554 100644 --- a/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/HttpCache/HttpCacheTest.php @@ -1069,7 +1069,7 @@ class HttpCacheTest extends HttpCacheTestCase $this->setNextResponses($responses); $this->request('GET', '/', array(), array(), true); - $this->assertEquals("Hello World! My name is Bobby.", $this->response->getContent()); + $this->assertEquals('Hello World! My name is Bobby.', $this->response->getContent()); // check for 100 or 99 as the test can be executed after a second change $this->assertTrue(in_array($this->response->getTtl(), array(99, 100))); diff --git a/src/Symfony/Component/HttpKernel/Tests/Profiler/FileProfilerStorageTest.php b/src/Symfony/Component/HttpKernel/Tests/Profiler/FileProfilerStorageTest.php index 3c2d04c0d4..6c74621419 100644 --- a/src/Symfony/Component/HttpKernel/Tests/Profiler/FileProfilerStorageTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/Profiler/FileProfilerStorageTest.php @@ -94,7 +94,7 @@ class FileProfilerStorageTest extends AbstractProfilerStorageTest fwrite($h, "line1\n\n\nline2\n"); fseek($h, 0, SEEK_END); - $this->assertEquals("line2", $r->invoke(self::$storage, $h)); - $this->assertEquals("line1", $r->invoke(self::$storage, $h)); + $this->assertEquals('line2', $r->invoke(self::$storage, $h)); + $this->assertEquals('line1', $r->invoke(self::$storage, $h)); } } diff --git a/src/Symfony/Component/Intl/Data/Bundle/Writer/TextBundleWriter.php b/src/Symfony/Component/Intl/Data/Bundle/Writer/TextBundleWriter.php index 281f90bdd5..aa078db5cd 100644 --- a/src/Symfony/Component/Intl/Data/Bundle/Writer/TextBundleWriter.php +++ b/src/Symfony/Component/Intl/Data/Bundle/Writer/TextBundleWriter.php @@ -145,7 +145,7 @@ class TextBundleWriter implements BundleWriterInterface fprintf($file, "%s%d,\n", str_repeat(' ', $indentation + 1), $int); } - fprintf($file, "%s}", str_repeat(' ', $indentation)); + fprintf($file, '%s}', str_repeat(' ', $indentation)); } /** @@ -212,7 +212,7 @@ class TextBundleWriter implements BundleWriterInterface } if (!$fallback) { - fwrite($file, ":table(nofallback)"); + fwrite($file, ':table(nofallback)'); } fwrite($file, "{\n"); diff --git a/src/Symfony/Component/Intl/Resources/bin/common.php b/src/Symfony/Component/Intl/Resources/bin/common.php index 1e25265d57..59b2f5eb30 100644 --- a/src/Symfony/Component/Intl/Resources/bin/common.php +++ b/src/Symfony/Component/Intl/Resources/bin/common.php @@ -79,11 +79,11 @@ set_exception_handler(function (\Exception $exception) { echo "Caused by\n"; } - echo get_class($cause).": ".$cause->getMessage()."\n"; + echo get_class($cause).': '.$cause->getMessage()."\n"; echo "\n"; - echo $cause->getFile().":".$cause->getLine()."\n"; + echo $cause->getFile().':'.$cause->getLine()."\n"; foreach ($cause->getTrace() as $trace) { - echo $trace['file'].":".$trace['line']."\n"; + echo $trace['file'].':'.$trace['line']."\n"; } echo "\n"; diff --git a/src/Symfony/Component/Intl/Resources/bin/update-data.php b/src/Symfony/Component/Intl/Resources/bin/update-data.php index bfe99ecb3e..17d12d137d 100644 --- a/src/Symfony/Component/Intl/Resources/bin/update-data.php +++ b/src/Symfony/Component/Intl/Resources/bin/update-data.php @@ -57,7 +57,7 @@ MESSAGE } echo LINE; -echo centered("ICU Resource Bundle Compilation")."\n"; +echo centered('ICU Resource Bundle Compilation')."\n"; echo LINE; if (!Intl::isExtensionLoaded()) { @@ -123,42 +123,42 @@ if ($argc >= 3) { // will run into problems when building genrb. $filesystem->mkdir($sourceDir.'/bin'); - echo "[1/6] libicudata.so..."; + echo '[1/6] libicudata.so...'; cd($sourceDir.'/stubdata'); run('make 2>&1 && make install 2>&1'); echo " ok.\n"; - echo "[2/6] libicuuc.so..."; + echo '[2/6] libicuuc.so...'; cd($sourceDir.'/common'); run('make 2>&1 && make install 2>&1'); echo " ok.\n"; - echo "[3/6] libicui18n.so..."; + echo '[3/6] libicui18n.so...'; cd($sourceDir.'/i18n'); run('make 2>&1 && make install 2>&1'); echo " ok.\n"; - echo "[4/6] libicutu.so..."; + echo '[4/6] libicutu.so...'; cd($sourceDir.'/tools/toolutil'); run('make 2>&1 && make install 2>&1'); echo " ok.\n"; - echo "[5/6] libicuio.so..."; + echo '[5/6] libicuio.so...'; cd($sourceDir.'/io'); run('make 2>&1 && make install 2>&1'); echo " ok.\n"; - echo "[6/6] genrb..."; + echo '[6/6] genrb...'; cd($sourceDir.'/tools/genrb'); run('make 2>&1 && make install 2>&1'); diff --git a/src/Symfony/Component/Process/Process.php b/src/Symfony/Component/Process/Process.php index 0c886d1c0e..8c259f5c1f 100644 --- a/src/Symfony/Component/Process/Process.php +++ b/src/Symfony/Component/Process/Process.php @@ -668,7 +668,7 @@ class Process $timeoutMicro = microtime(true) + $timeout; if ($this->isRunning()) { if ('\\' === DIRECTORY_SEPARATOR && !$this->isSigchildEnabled()) { - exec(sprintf("taskkill /F /T /PID %d 2>&1", $this->getPid()), $output, $exitCode); + exec(sprintf('taskkill /F /T /PID %d 2>&1', $this->getPid()), $output, $exitCode); if ($exitCode > 0) { throw new RuntimeException('Unable to kill the process'); } diff --git a/src/Symfony/Component/Process/Tests/ProcessBuilderTest.php b/src/Symfony/Component/Process/Tests/ProcessBuilderTest.php index e8ef6bc98a..d78b992dc9 100644 --- a/src/Symfony/Component/Process/Tests/ProcessBuilderTest.php +++ b/src/Symfony/Component/Process/Tests/ProcessBuilderTest.php @@ -117,7 +117,7 @@ class ProcessBuilderTest extends \PHPUnit_Framework_TestCase $proc = $pb->getProcess(); - $this->assertContains("second", $proc->getCommandLine()); + $this->assertContains('second', $proc->getCommandLine()); } public function testPrefixIsPrependedToAllGeneratedProcess() diff --git a/src/Symfony/Component/Process/Tests/ProcessFailedExceptionTest.php b/src/Symfony/Component/Process/Tests/ProcessFailedExceptionTest.php index fd349288af..94410813b5 100644 --- a/src/Symfony/Component/Process/Tests/ProcessFailedExceptionTest.php +++ b/src/Symfony/Component/Process/Tests/ProcessFailedExceptionTest.php @@ -49,8 +49,8 @@ class ProcessFailedExceptionTest extends \PHPUnit_Framework_TestCase $cmd = 'php'; $exitCode = 1; $exitText = 'General error'; - $output = "Command output"; - $errorOutput = "FATAL: Unexpected error"; + $output = 'Command output'; + $errorOutput = 'FATAL: Unexpected error'; $process = $this->getMock( 'Symfony\Component\Process\Process', diff --git a/src/Symfony/Component/Process/Tests/SignalListener.php b/src/Symfony/Component/Process/Tests/SignalListener.php index 32910e1706..335ac6027e 100644 --- a/src/Symfony/Component/Process/Tests/SignalListener.php +++ b/src/Symfony/Component/Process/Tests/SignalListener.php @@ -3,7 +3,7 @@ // required for signal handling declare (ticks = 1); -pcntl_signal(SIGUSR1, function () {echo "Caught SIGUSR1"; exit;}); +pcntl_signal(SIGUSR1, function () {echo 'Caught SIGUSR1'; exit;}); $n = 0; diff --git a/src/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php b/src/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php index b0f196293f..79ec42e62f 100644 --- a/src/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php +++ b/src/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php @@ -151,18 +151,18 @@ class ApacheMatcherDumper extends MatcherDumper } if ($compiledRoute->getHostRegex()) { - $rule[] = sprintf("RewriteCond %%{ENV:__ROUTING_host_%s} =1", $hostRegexUnique); + $rule[] = sprintf('RewriteCond %%{ENV:__ROUTING_host_%s} =1', $hostRegexUnique); } $rule[] = "RewriteCond %{REQUEST_URI} $regex"; - $rule[] = sprintf("RewriteCond %%{REQUEST_METHOD} !^(%s)$ [NC]", implode('|', $methods)); + $rule[] = sprintf('RewriteCond %%{REQUEST_METHOD} !^(%s)$ [NC]', implode('|', $methods)); $rule[] = sprintf('RewriteRule .* - [S=%d,%s]', $hasTrailingSlash ? 2 : 1, implode(',', $allow)); } // redirect with trailing slash appended if ($hasTrailingSlash) { if ($compiledRoute->getHostRegex()) { - $rule[] = sprintf("RewriteCond %%{ENV:__ROUTING_host_%s} =1", $hostRegexUnique); + $rule[] = sprintf('RewriteCond %%{ENV:__ROUTING_host_%s} =1', $hostRegexUnique); } $rule[] = 'RewriteCond %{REQUEST_URI} '.substr($regex, 0, -2).'$'; @@ -172,7 +172,7 @@ class ApacheMatcherDumper extends MatcherDumper // the main rule if ($compiledRoute->getHostRegex()) { - $rule[] = sprintf("RewriteCond %%{ENV:__ROUTING_host_%s} =1", $hostRegexUnique); + $rule[] = sprintf('RewriteCond %%{ENV:__ROUTING_host_%s} =1', $hostRegexUnique); } $rule[] = "RewriteCond %{REQUEST_URI} $regex"; diff --git a/src/Symfony/Component/Routing/Matcher/Dumper/DumperPrefixCollection.php b/src/Symfony/Component/Routing/Matcher/Dumper/DumperPrefixCollection.php index 849e22e0ee..7db9eb24ee 100644 --- a/src/Symfony/Component/Routing/Matcher/Dumper/DumperPrefixCollection.php +++ b/src/Symfony/Component/Routing/Matcher/Dumper/DumperPrefixCollection.php @@ -75,7 +75,7 @@ class DumperPrefixCollection extends DumperCollection } // Reached only if the root has a non empty prefix - throw new \LogicException("The collection root must not have a prefix"); + throw new \LogicException('The collection root must not have a prefix'); } /** diff --git a/src/Symfony/Component/Routing/RouteCompiler.php b/src/Symfony/Component/Routing/RouteCompiler.php index 8a7efbdbc2..e998b93e93 100644 --- a/src/Symfony/Component/Routing/RouteCompiler.php +++ b/src/Symfony/Component/Routing/RouteCompiler.php @@ -218,7 +218,7 @@ class RouteCompiler implements RouteCompilerInterface $nbTokens = count($tokens); if ($nbTokens - 1 == $index) { // Close the optional subpatterns - $regexp .= str_repeat(")?", $nbTokens - $firstOptional - (0 === $firstOptional ? 1 : 0)); + $regexp .= str_repeat(')?', $nbTokens - $firstOptional - (0 === $firstOptional ? 1 : 0)); } } diff --git a/src/Symfony/Component/Security/Core/Authentication/Provider/DaoAuthenticationProvider.php b/src/Symfony/Component/Security/Core/Authentication/Provider/DaoAuthenticationProvider.php index 4913be8466..b7b4917e90 100644 --- a/src/Symfony/Component/Security/Core/Authentication/Provider/DaoAuthenticationProvider.php +++ b/src/Symfony/Component/Security/Core/Authentication/Provider/DaoAuthenticationProvider.php @@ -59,7 +59,7 @@ class DaoAuthenticationProvider extends UserAuthenticationProvider throw new BadCredentialsException('The credentials were changed from another session.'); } } else { - if ("" === ($presentedPassword = $token->getCredentials())) { + if ('' === ($presentedPassword = $token->getCredentials())) { throw new BadCredentialsException('The presented password cannot be empty.'); } diff --git a/src/Symfony/Component/Security/Http/Firewall/AbstractPreAuthenticatedListener.php b/src/Symfony/Component/Security/Http/Firewall/AbstractPreAuthenticatedListener.php index 895df5333e..f040107ac1 100644 --- a/src/Symfony/Component/Security/Http/Firewall/AbstractPreAuthenticatedListener.php +++ b/src/Symfony/Component/Security/Http/Firewall/AbstractPreAuthenticatedListener.php @@ -107,7 +107,7 @@ abstract class AbstractPreAuthenticatedListener implements ListenerInterface $this->securityContext->setToken(null); if (null !== $this->logger) { - $this->logger->info(sprintf("Cleared security context due to exception: %s", $exception->getMessage())); + $this->logger->info(sprintf('Cleared security context due to exception: %s', $exception->getMessage())); } } } diff --git a/src/Symfony/Component/Security/Tests/Acl/Dbal/AclProviderBenchmarkTest.php b/src/Symfony/Component/Security/Tests/Acl/Dbal/AclProviderBenchmarkTest.php index 1a46d2712c..f1c9554b08 100644 --- a/src/Symfony/Component/Security/Tests/Acl/Dbal/AclProviderBenchmarkTest.php +++ b/src/Symfony/Component/Security/Tests/Acl/Dbal/AclProviderBenchmarkTest.php @@ -56,7 +56,7 @@ class AclProviderBenchmarkTest extends \PHPUnit_Framework_TestCase // get some random test object identities from the database $oids = array(); - $stmt = $this->con->executeQuery("SELECT object_identifier, class_type FROM acl_object_identities o INNER JOIN acl_classes c ON c.id = o.class_id ORDER BY RAND() LIMIT 25"); + $stmt = $this->con->executeQuery('SELECT object_identifier, class_type FROM acl_object_identities o INNER JOIN acl_classes c ON c.id = o.class_id ORDER BY RAND() LIMIT 25'); foreach ($stmt->fetchAll() as $oid) { $oids[] = new ObjectIdentity($oid['object_identifier'], $oid['class_type']); } @@ -66,7 +66,7 @@ class AclProviderBenchmarkTest extends \PHPUnit_Framework_TestCase $start = microtime(true); $provider->findAcls($oids); $time = microtime(true) - $start; - echo "Total Time: ".$time."s\n"; + echo 'Total Time: '.$time."s\n"; } /** @@ -77,7 +77,7 @@ class AclProviderBenchmarkTest extends \PHPUnit_Framework_TestCase { $sm = $this->con->getSchemaManager(); $sm->dropAndCreateDatabase('testdb'); - $this->con->exec("USE testdb"); + $this->con->exec('USE testdb'); // import the schema $schema = new Schema($options = $this->getOptions()); diff --git a/src/Symfony/Component/Security/Tests/Acl/Dbal/MutableAclProviderTest.php b/src/Symfony/Component/Security/Tests/Acl/Dbal/MutableAclProviderTest.php index faa92611bb..f6d66ef115 100644 --- a/src/Symfony/Component/Security/Tests/Acl/Dbal/MutableAclProviderTest.php +++ b/src/Symfony/Component/Security/Tests/Acl/Dbal/MutableAclProviderTest.php @@ -448,7 +448,7 @@ class MutableAclProviderTest extends \PHPUnit_Framework_TestCase if (isset($aclData['parent_acl'])) { if (isset($aclIds[$aclData['parent_acl']])) { - $con->executeQuery("UPDATE acl_object_identities SET parent_object_identity_id = ".$aclIds[$aclData['parent_acl']]." WHERE id = ".$aclId); + $con->executeQuery('UPDATE acl_object_identities SET parent_object_identity_id = '.$aclIds[$aclData['parent_acl']].' WHERE id = '.$aclId); $con->executeQuery($this->callMethod($provider, 'getInsertObjectIdentityRelationSql', array($aclId, $aclIds[$aclData['parent_acl']]))); } else { $parentAcls[$aclId] = $aclData['parent_acl']; @@ -461,7 +461,7 @@ class MutableAclProviderTest extends \PHPUnit_Framework_TestCase throw new \InvalidArgumentException(sprintf('"%s" does not exist.', $name)); } - $con->executeQuery(sprintf("UPDATE acl_object_identities SET parent_object_identity_id = %d WHERE id = %d", $aclIds[$name], $aclId)); + $con->executeQuery(sprintf('UPDATE acl_object_identities SET parent_object_identity_id = %d WHERE id = %d', $aclIds[$name], $aclId)); $con->executeQuery($this->callMethod($provider, 'getInsertObjectIdentityRelationSql', array($aclId, $aclIds[$name]))); } diff --git a/src/Symfony/Component/Security/Tests/Core/Authorization/AccessDecisionManagerTest.php b/src/Symfony/Component/Security/Tests/Core/Authorization/AccessDecisionManagerTest.php index 74e790af88..cbb39c4052 100644 --- a/src/Symfony/Component/Security/Tests/Core/Authorization/AccessDecisionManagerTest.php +++ b/src/Symfony/Component/Security/Tests/Core/Authorization/AccessDecisionManagerTest.php @@ -99,8 +99,8 @@ class AccessDecisionManagerTest extends \PHPUnit_Framework_TestCase $voter->expects($this->exactly(2)) ->method('vote') ->will($this->returnValueMap(array( - array($token, null, array("ROLE_FOO"), $vote1), - array($token, null, array("ROLE_BAR"), $vote2), + array($token, null, array('ROLE_FOO'), $vote1), + array($token, null, array('ROLE_BAR'), $vote2), ))) ; diff --git a/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php b/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php index fd63872894..d3fe2588ac 100644 --- a/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php +++ b/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php @@ -277,7 +277,7 @@ class XmlEncoder extends SerializerAwareEncoder implements EncoderInterface, Dec } else { $data['item'][] = $value; } - } elseif (array_key_exists($key, $data) || $key == "entry") { + } elseif (array_key_exists($key, $data) || $key == 'entry') { if ((false === is_array($data[$key])) || (false === isset($data[$key][0]))) { $data[$key] = array($data[$key]); } @@ -308,7 +308,7 @@ class XmlEncoder extends SerializerAwareEncoder implements EncoderInterface, Dec if (is_array($data) || $data instanceof \Traversable) { foreach ($data as $key => $data) { //Ah this is the magic @ attribute types. - if (0 === strpos($key, "@") && is_scalar($data) && $this->isElementNameValid($attributeName = substr($key, 1))) { + if (0 === strpos($key, '@') && is_scalar($data) && $this->isElementNameValid($attributeName = substr($key, 1))) { $parentNode->setAttribute($attributeName, $data); } elseif ($key === '#') { $append = $this->selectNodeType($parentNode, $data); @@ -327,7 +327,7 @@ class XmlEncoder extends SerializerAwareEncoder implements EncoderInterface, Dec $append = $this->appendNode($parentNode, $data, $key); } } elseif (is_numeric($key) || !$this->isElementNameValid($key)) { - $append = $this->appendNode($parentNode, $data, "item", $key); + $append = $this->appendNode($parentNode, $data, 'item', $key); } else { $append = $this->appendNode($parentNode, $data, $key); } diff --git a/src/Symfony/Component/Serializer/Tests/Encoder/JsonEncoderTest.php b/src/Symfony/Component/Serializer/Tests/Encoder/JsonEncoderTest.php index 87f685c667..c7bd11e7ae 100644 --- a/src/Symfony/Component/Serializer/Tests/Encoder/JsonEncoderTest.php +++ b/src/Symfony/Component/Serializer/Tests/Encoder/JsonEncoderTest.php @@ -26,7 +26,7 @@ class JsonEncoderTest extends \PHPUnit_Framework_TestCase public function testEncodeScalar() { $obj = new \stdClass(); - $obj->foo = "foo"; + $obj->foo = 'foo'; $expected = '{"foo":"foo"}'; @@ -47,14 +47,14 @@ class JsonEncoderTest extends \PHPUnit_Framework_TestCase $context = array('json_encode_options' => JSON_NUMERIC_CHECK); $arr = array(); - $arr['foo'] = "3"; + $arr['foo'] = '3'; $expected = '{"foo":3}'; $this->assertEquals($expected, $this->serializer->serialize($arr, 'json', $context)); $arr = array(); - $arr['foo'] = "3"; + $arr['foo'] = '3'; $expected = '{"foo":"3"}'; @@ -72,7 +72,7 @@ class JsonEncoderTest extends \PHPUnit_Framework_TestCase $obj->foo = 'foo'; $obj->bar = array('a', 'b'); $obj->baz = array('key' => 'val', 'key2' => 'val', 'A B' => 'bar', 'item' => array(array('title' => 'title1'), array('title' => 'title2')), 'Barry' => array('FooBar' => array('Baz' => 'Ed', '@id' => 1))); - $obj->qux = "1"; + $obj->qux = '1'; return $obj; } diff --git a/src/Symfony/Component/Serializer/Tests/Encoder/XmlEncoderTest.php b/src/Symfony/Component/Serializer/Tests/Encoder/XmlEncoderTest.php index f2ee035ce2..a6c7c9398d 100644 --- a/src/Symfony/Component/Serializer/Tests/Encoder/XmlEncoderTest.php +++ b/src/Symfony/Component/Serializer/Tests/Encoder/XmlEncoderTest.php @@ -32,7 +32,7 @@ class XmlEncoderTest extends \PHPUnit_Framework_TestCase public function testEncodeScalar() { $obj = new ScalarDummy(); - $obj->xmlFoo = "foo"; + $obj->xmlFoo = 'foo'; $expected = ''."\n". 'foo'."\n"; @@ -43,7 +43,7 @@ class XmlEncoderTest extends \PHPUnit_Framework_TestCase public function testSetRootNodeName() { $obj = new ScalarDummy(); - $obj->xmlFoo = "foo"; + $obj->xmlFoo = 'foo'; $this->encoder->setRootNodeName('test'); $expected = ''."\n". @@ -70,11 +70,11 @@ class XmlEncoderTest extends \PHPUnit_Framework_TestCase '@name' => 'Bar', ), 'Foo' => array( - 'Bar' => "Test", + 'Bar' => 'Test', '@Type' => 'test', ), 'föo_bär' => 'a', - "Bar" => array(1,2,3), + 'Bar' => array(1,2,3), 'a' => 'b', ); $expected = ''."\n". @@ -275,28 +275,28 @@ class XmlEncoderTest extends \PHPUnit_Framework_TestCase $obj = new ScalarDummy(); $obj->xmlFoo = array( 'foo-bar' => array( - '@key' => "value", - 'item' => array("@key" => 'key', "key-val" => 'val'), + '@key' => 'value', + 'item' => array('@key' => 'key', 'key-val' => 'val'), ), 'Foo' => array( - 'Bar' => "Test", + 'Bar' => 'Test', '@Type' => 'test', ), 'föo_bär' => 'a', - "Bar" => array(1,2,3), + 'Bar' => array(1,2,3), 'a' => 'b', ); $expected = array( 'foo-bar' => array( - '@key' => "value", - 'key' => array('@key' => 'key', "key-val" => 'val'), + '@key' => 'value', + 'key' => array('@key' => 'key', 'key-val' => 'val'), ), 'Foo' => array( - 'Bar' => "Test", + 'Bar' => 'Test', '@Type' => 'test', ), 'föo_bär' => 'a', - "Bar" => array(1,2,3), + 'Bar' => array(1,2,3), 'a' => 'b', ); $xml = $this->encoder->encode($obj, 'xml'); @@ -355,7 +355,7 @@ class XmlEncoderTest extends \PHPUnit_Framework_TestCase $obj->foo = 'foo'; $obj->bar = array('a', 'b'); $obj->baz = array('key' => 'val', 'key2' => 'val', 'A B' => 'bar', 'item' => array(array('title' => 'title1'), array('title' => 'title2')), 'Barry' => array('FooBar' => array('Baz' => 'Ed', '@id' => 1))); - $obj->qux = "1"; + $obj->qux = '1'; return $obj; } diff --git a/src/Symfony/Component/Serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php b/src/Symfony/Component/Serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php index eb65810453..b22ccb5319 100644 --- a/src/Symfony/Component/Serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php +++ b/src/Symfony/Component/Serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php @@ -275,7 +275,7 @@ class GetSetDummy public function otherMethod() { - throw new \RuntimeException("Dummy::otherMethod() should not be called"); + throw new \RuntimeException('Dummy::otherMethod() should not be called'); } } @@ -302,7 +302,7 @@ class GetConstructorDummy public function otherMethod() { - throw new \RuntimeException("Dummy::otherMethod() should not be called"); + throw new \RuntimeException('Dummy::otherMethod() should not be called'); } } @@ -336,6 +336,6 @@ class GetConstructorOptionalArgsDummy public function otherMethod() { - throw new \RuntimeException("Dummy::otherMethod() should not be called"); + throw new \RuntimeException('Dummy::otherMethod() should not be called'); } } diff --git a/src/Symfony/Component/Stopwatch/Tests/StopwatchEventTest.php b/src/Symfony/Component/Stopwatch/Tests/StopwatchEventTest.php index 395c102944..ccc4031967 100644 --- a/src/Symfony/Component/Stopwatch/Tests/StopwatchEventTest.php +++ b/src/Symfony/Component/Stopwatch/Tests/StopwatchEventTest.php @@ -138,6 +138,6 @@ class StopwatchEventTest extends \PHPUnit_Framework_TestCase */ public function testInvalidOriginThrowsAnException() { - new StopwatchEvent("abc"); + new StopwatchEvent('abc'); } } diff --git a/src/Symfony/Component/Translation/Loader/MoFileLoader.php b/src/Symfony/Component/Translation/Loader/MoFileLoader.php index 18d07b0ccc..9cab3f0d8d 100644 --- a/src/Symfony/Component/Translation/Loader/MoFileLoader.php +++ b/src/Symfony/Component/Translation/Loader/MoFileLoader.php @@ -88,7 +88,7 @@ class MoFileLoader extends ArrayLoader $stat = fstat($stream); if ($stat['size'] < self::MO_HEADER_SIZE) { - throw new InvalidResourceException("MO stream content has an invalid format."); + throw new InvalidResourceException('MO stream content has an invalid format.'); } $magic = unpack('V1', fread($stream, 4)); $magic = hexdec(substr(dechex(current($magic)), -8)); @@ -98,7 +98,7 @@ class MoFileLoader extends ArrayLoader } elseif ($magic == self::MO_BIG_ENDIAN_MAGIC) { $isBigEndian = true; } else { - throw new InvalidResourceException("MO stream content has an invalid format."); + throw new InvalidResourceException('MO stream content has an invalid format.'); } // formatRevision diff --git a/src/Symfony/Component/Translation/PluralizationRules.php b/src/Symfony/Component/Translation/PluralizationRules.php index e9cd84d43b..9cedd337f8 100644 --- a/src/Symfony/Component/Translation/PluralizationRules.php +++ b/src/Symfony/Component/Translation/PluralizationRules.php @@ -31,9 +31,9 @@ class PluralizationRules */ public static function get($number, $locale) { - if ("pt_BR" == $locale) { + if ('pt_BR' == $locale) { // temporary set a locale for brazilian - $locale = "xbr"; + $locale = 'xbr'; } if (strlen($locale) > 3) { @@ -197,9 +197,9 @@ class PluralizationRules */ public static function set($rule, $locale) { - if ("pt_BR" == $locale) { + if ('pt_BR' == $locale) { // temporary set a locale for brazilian - $locale = "xbr"; + $locale = 'xbr'; } if (strlen($locale) > 3) { diff --git a/src/Symfony/Component/Validator/Constraints/EmailValidator.php b/src/Symfony/Component/Validator/Constraints/EmailValidator.php index b3789a130d..f3a25bdb11 100644 --- a/src/Symfony/Component/Validator/Constraints/EmailValidator.php +++ b/src/Symfony/Component/Validator/Constraints/EmailValidator.php @@ -77,6 +77,6 @@ class EmailValidator extends ConstraintValidator */ private function checkHost($host) { - return $this->checkMX($host) || (checkdnsrr($host, "A") || checkdnsrr($host, "AAAA")); + return $this->checkMX($host) || (checkdnsrr($host, 'A') || checkdnsrr($host, 'AAAA')); } } diff --git a/src/Symfony/Component/Validator/Constraints/IssnValidator.php b/src/Symfony/Component/Validator/Constraints/IssnValidator.php index 24618eac50..8d9609fa3f 100644 --- a/src/Symfony/Component/Validator/Constraints/IssnValidator.php +++ b/src/Symfony/Component/Validator/Constraints/IssnValidator.php @@ -42,7 +42,7 @@ class IssnValidator extends ConstraintValidator // Compose regex pattern $digitsPattern = $constraint->requireHyphen ? '\d{4}-\d{3}' : '\d{4}-?\d{3}'; $checkSumPattern = $constraint->caseSensitive ? '[\d|X]' : '[\d|X|x]'; - $pattern = "/^".$digitsPattern.$checkSumPattern."$/"; + $pattern = '/^'.$digitsPattern.$checkSumPattern.'$/'; if (!preg_match($pattern, $value)) { $this->context->addViolation($constraint->message, array( diff --git a/src/Symfony/Component/Validator/Tests/Constraints/CollectionTest.php b/src/Symfony/Component/Validator/Tests/Constraints/CollectionTest.php index 4b485a9b10..79f50b0b5b 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/CollectionTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/CollectionTest.php @@ -75,16 +75,16 @@ class CollectionTest extends \PHPUnit_Framework_TestCase public function testAcceptOptionalConstraintAsOneElementArray() { $collection1 = new Collection(array( - "fields" => array( - "alternate_email" => array( + 'fields' => array( + 'alternate_email' => array( new Optional(new Email()), ), ), )); $collection2 = new Collection(array( - "fields" => array( - "alternate_email" => new Optional(new Email()), + 'fields' => array( + 'alternate_email' => new Optional(new Email()), ), )); @@ -94,16 +94,16 @@ class CollectionTest extends \PHPUnit_Framework_TestCase public function testAcceptRequiredConstraintAsOneElementArray() { $collection1 = new Collection(array( - "fields" => array( - "alternate_email" => array( + 'fields' => array( + 'alternate_email' => array( new Required(new Email()), ), ), )); $collection2 = new Collection(array( - "fields" => array( - "alternate_email" => new Required(new Email()), + 'fields' => array( + 'alternate_email' => new Required(new Email()), ), )); diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LengthValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LengthValidatorTest.php index 6147e424fe..6f44818396 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/LengthValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/LengthValidatorTest.php @@ -96,10 +96,10 @@ class LengthValidatorTest extends AbstractConstraintValidatorTest } return array( - array("é", "utf8", true), - array("\xE9", "CP1252", true), - array("\xE9", "XXX", false), - array("\xE9", "utf8", false), + array('é', 'utf8', true), + array("\xE9", 'CP1252', true), + array("\xE9", 'XXX', false), + array("\xE9", 'utf8', false), ); } diff --git a/src/Symfony/Component/Yaml/Tests/InlineTest.php b/src/Symfony/Component/Yaml/Tests/InlineTest.php index 0cbea85ded..d3329bc2f1 100644 --- a/src/Symfony/Component/Yaml/Tests/InlineTest.php +++ b/src/Symfony/Component/Yaml/Tests/InlineTest.php @@ -48,7 +48,7 @@ class InlineTest extends \PHPUnit_Framework_TestCase $required_locales = array('fr_FR.UTF-8', 'fr_FR.UTF8', 'fr_FR.utf-8', 'fr_FR.utf8', 'French_France.1252'); if (false === setlocale(LC_ALL, $required_locales)) { - $this->markTestSkipped('Could not set any of required locales: '.implode(", ", $required_locales)); + $this->markTestSkipped('Could not set any of required locales: '.implode(', ', $required_locales)); } $this->assertEquals('1.2', Inline::dump(1.2)); @@ -219,7 +219,7 @@ class InlineTest extends \PHPUnit_Framework_TestCase '{foo: \'bar\', bar: \'foo: bar\'}' => array('foo' => 'bar', 'bar' => 'foo: bar'), '{\'foo\': \'bar\', "bar": \'foo: bar\'}' => array('foo' => 'bar', 'bar' => 'foo: bar'), '{\'foo\'\'\': \'bar\', "bar\"": \'foo: bar\'}' => array('foo\'' => 'bar', "bar\"" => 'foo: bar'), - '{\'foo: \': \'bar\', "bar: ": \'foo: bar\'}' => array('foo: ' => 'bar', "bar: " => 'foo: bar'), + '{\'foo: \': \'bar\', "bar: ": \'foo: bar\'}' => array('foo: ' => 'bar', 'bar: ' => 'foo: bar'), // nested sequences and mappings '[foo, [bar, foo]]' => array('foo', array('bar', 'foo')), diff --git a/src/Symfony/Component/Yaml/Tests/ParserTest.php b/src/Symfony/Component/Yaml/Tests/ParserTest.php index 5c71889cb2..d74bf18c1b 100644 --- a/src/Symfony/Component/Yaml/Tests/ParserTest.php +++ b/src/Symfony/Component/Yaml/Tests/ParserTest.php @@ -259,8 +259,8 @@ bar: >- EOF; $expected = array( - 'foo' => "one two", - 'bar' => "one two", + 'foo' => 'one two', + 'bar' => 'one two', ); $tests['Folded block chomping strip with single trailing newline'] = array($expected, $yaml); @@ -276,8 +276,8 @@ bar: >- EOF; $expected = array( - 'foo' => "one two", - 'bar' => "one two", + 'foo' => 'one two', + 'bar' => 'one two', ); $tests['Folded block chomping strip with multiple trailing newlines'] = array($expected, $yaml); @@ -290,8 +290,8 @@ bar: >- two EOF; $expected = array( - 'foo' => "one two", - 'bar' => "one two", + 'foo' => 'one two', + 'bar' => 'one two', ); $tests['Folded block chomping strip without trailing newline'] = array($expected, $yaml); @@ -337,7 +337,7 @@ bar: > EOF; $expected = array( 'foo' => "one two\n", - 'bar' => "one two", + 'bar' => 'one two', ); $tests['Folded block chomping clip without trailing newline'] = array($expected, $yaml); @@ -383,7 +383,7 @@ bar: >+ EOF; $expected = array( 'foo' => "one two\n", - 'bar' => "one two", + 'bar' => 'one two', ); $tests['Folded block chomping keep without trailing newline'] = array($expected, $yaml); @@ -455,9 +455,9 @@ EOF; } $yamls = array( - iconv("UTF-8", "ISO-8859-1", "foo: 'äöüß'"), - iconv("UTF-8", "ISO-8859-15", "euro: '€'"), - iconv("UTF-8", "CP1252", "cp1252: '©ÉÇáñ'"), + iconv('UTF-8', 'ISO-8859-1', "foo: 'äöüß'"), + iconv('UTF-8', 'ISO-8859-15', "euro: '€'"), + iconv('UTF-8', 'CP1252', "cp1252: '©ÉÇáñ'"), ); foreach ($yamls as $yaml) {