diff --git a/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php b/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php index 95decc6f31..a11acfc45b 100644 --- a/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php +++ b/src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php @@ -207,11 +207,11 @@ abstract class AbstractDoctrineExtension extends Extension } elseif ($driverType == 'annotation') { $mappingDriverDef = new Definition('%'.$this->getObjectManagerElementName('metadata.'.$driverType.'.class%'), array( new Reference($this->getObjectManagerElementName('metadata.annotation_reader')), - array_values($driverPaths) + array_values($driverPaths), )); } else { $mappingDriverDef = new Definition('%'.$this->getObjectManagerElementName('metadata.'.$driverType.'.class%'), array( - array_values($driverPaths) + array_values($driverPaths), )); } $mappingDriverDef->setPublic(false); @@ -320,7 +320,7 @@ abstract class AbstractDoctrineExtension extends Extension $cacheDef = new Definition($memcacheClass); $memcacheInstance = new Definition($memcacheInstanceClass); $memcacheInstance->addMethodCall('connect', array( - $memcacheHost, $memcachePort + $memcacheHost, $memcachePort, )); $container->setDefinition($this->getObjectManagerElementName(sprintf('%s_memcache_instance', $objectManager['name'])), $memcacheInstance); $cacheDef->addMethodCall('setMemcache', array(new Reference($this->getObjectManagerElementName(sprintf('%s_memcache_instance', $objectManager['name']))))); @@ -333,7 +333,7 @@ abstract class AbstractDoctrineExtension extends Extension $cacheDef = new Definition($memcachedClass); $memcachedInstance = new Definition($memcachedInstanceClass); $memcachedInstance->addMethodCall('addServer', array( - $memcachedHost, $memcachedPort + $memcachedHost, $memcachedPort, )); $container->setDefinition($this->getObjectManagerElementName(sprintf('%s_memcached_instance', $objectManager['name'])), $memcachedInstance); $cacheDef->addMethodCall('setMemcached', array(new Reference($this->getObjectManagerElementName(sprintf('%s_memcached_instance', $objectManager['name']))))); @@ -346,7 +346,7 @@ abstract class AbstractDoctrineExtension extends Extension $cacheDef = new Definition($redisClass); $redisInstance = new Definition($redisInstanceClass); $redisInstance->addMethodCall('connect', array( - $redisHost, $redisPort + $redisHost, $redisPort, )); $container->setDefinition($this->getObjectManagerElementName(sprintf('%s_redis_instance', $objectManager['name'])), $redisInstance); $cacheDef->addMethodCall('setRedis', array(new Reference($this->getObjectManagerElementName(sprintf('%s_redis_instance', $objectManager['name']))))); diff --git a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php index cc8ac9891a..ce9dce875f 100644 --- a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php +++ b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php @@ -452,7 +452,7 @@ class EntityChoiceList extends ObjectChoiceList { if (!$this->em->contains($entity)) { throw new RuntimeException( - 'Entities passed to the choice field must be managed. Maybe ' . + 'Entities passed to the choice field must be managed. Maybe '. 'persist them in the entity manager?' ); } diff --git a/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php b/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php index 83ce96f0fa..7a027df1e7 100644 --- a/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php +++ b/src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php @@ -60,7 +60,7 @@ abstract class DoctrineType extends AbstractType public function setDefaultOptions(OptionsResolverInterface $resolver) { - $choiceListCache =& $this->choiceListCache; + $choiceListCache = & $this->choiceListCache; $registry = $this->registry; $propertyAccessor = $this->propertyAccessor; $type = $this; @@ -121,7 +121,7 @@ abstract class DoctrineType extends AbstractType $loaderHash, $choiceHashes, $preferredChoiceHashes, - $groupByHash + $groupByHash, ))); if (!isset($choiceListCache[$hash])) { @@ -150,7 +150,7 @@ abstract class DoctrineType extends AbstractType if (null === $em) { throw new RuntimeException(sprintf( - 'Class "%s" seems not to be a managed Doctrine entity. ' . + 'Class "%s" seems not to be a managed Doctrine entity. '. 'Did you forget to map it?', $options['class'] )); diff --git a/src/Symfony/Bridge/Doctrine/HttpFoundation/DbalSessionHandler.php b/src/Symfony/Bridge/Doctrine/HttpFoundation/DbalSessionHandler.php index d0c0577bec..88260a5270 100644 --- a/src/Symfony/Bridge/Doctrine/HttpFoundation/DbalSessionHandler.php +++ b/src/Symfony/Bridge/Doctrine/HttpFoundation/DbalSessionHandler.php @@ -218,18 +218,18 @@ class DbalSessionHandler implements \SessionHandlerInterface switch ($platform) { case 'mysql': - return "INSERT INTO $this->table ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time) " . + return "INSERT INTO $this->table ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time) ". "ON DUPLICATE KEY UPDATE $this->dataCol = VALUES($this->dataCol), $this->timeCol = VALUES($this->timeCol)"; case 'oracle': // DUAL is Oracle specific dummy table - return "MERGE INTO $this->table USING DUAL ON ($this->idCol = :id) " . - "WHEN NOT MATCHED THEN INSERT ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time) " . + return "MERGE INTO $this->table USING DUAL ON ($this->idCol = :id) ". + "WHEN NOT MATCHED THEN INSERT ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time) ". "WHEN MATCHED THEN UPDATE SET $this->dataCol = :data, $this->timeCol = :time"; case $this->con->getDatabasePlatform() instanceof SQLServer2008Platform: // MERGE is only available since SQL Server 2008 and must be terminated by semicolon // It also requires HOLDLOCK according to http://weblogs.sqlteam.com/dang/archive/2009/01/31/UPSERT-Race-Condition-With-MERGE.aspx - return "MERGE INTO $this->table WITH (HOLDLOCK) USING (SELECT 1 AS dummy) AS src ON ($this->idCol = :id) " . - "WHEN NOT MATCHED THEN INSERT ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time) " . + return "MERGE INTO $this->table WITH (HOLDLOCK) USING (SELECT 1 AS dummy) AS src ON ($this->idCol = :id) ". + "WHEN NOT MATCHED THEN INSERT ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time) ". "WHEN MATCHED THEN UPDATE SET $this->dataCol = :data, $this->timeCol = :time;"; case 'sqlite': return "INSERT OR REPLACE INTO $this->table ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time)"; diff --git a/src/Symfony/Bridge/Doctrine/Security/RememberMe/DoctrineTokenProvider.php b/src/Symfony/Bridge/Doctrine/Security/RememberMe/DoctrineTokenProvider.php index c96201cd21..d2e4b00726 100644 --- a/src/Symfony/Bridge/Doctrine/Security/RememberMe/DoctrineTokenProvider.php +++ b/src/Symfony/Bridge/Doctrine/Security/RememberMe/DoctrineTokenProvider.php @@ -61,7 +61,7 @@ class DoctrineTokenProvider implements TokenProviderInterface public function loadTokenBySeries($series) { $sql = 'SELECT class, username, value, lastUsed' - . ' FROM rememberme_token WHERE series=:series'; + .' FROM rememberme_token WHERE series=:series'; $paramValues = array('series' => $series); $paramTypes = array('series' => \PDO::PARAM_STR); $stmt = $this->conn->executeQuery($sql, $paramValues, $paramTypes); @@ -95,13 +95,13 @@ class DoctrineTokenProvider implements TokenProviderInterface public function updateToken($series, $tokenValue, \DateTime $lastUsed) { $sql = 'UPDATE rememberme_token SET value=:value, lastUsed=:lastUsed' - . ' WHERE series=:series'; + .' WHERE series=:series'; $paramValues = array('value' => $tokenValue, 'lastUsed' => $lastUsed, - 'series' => $series); + 'series' => $series,); $paramTypes = array('value' => \PDO::PARAM_STR, 'lastUsed' => DoctrineType::DATETIME, - 'series' => \PDO::PARAM_STR); + 'series' => \PDO::PARAM_STR,); $updated = $this->conn->executeUpdate($sql, $paramValues, $paramTypes); if ($updated < 1) { throw new TokenNotFoundException('No token found.'); @@ -114,18 +114,18 @@ class DoctrineTokenProvider implements TokenProviderInterface public function createNewToken(PersistentTokenInterface $token) { $sql = 'INSERT INTO rememberme_token' - . ' (class, username, series, value, lastUsed)' - . ' VALUES (:class, :username, :series, :value, :lastUsed)'; + .' (class, username, series, value, lastUsed)' + .' VALUES (:class, :username, :series, :value, :lastUsed)'; $paramValues = array('class' => $token->getClass(), 'username' => $token->getUsername(), 'series' => $token->getSeries(), 'value' => $token->getTokenValue(), - 'lastUsed' => $token->getLastUsed()); + 'lastUsed' => $token->getLastUsed(),); $paramTypes = array('class' => \PDO::PARAM_STR, 'username' => \PDO::PARAM_STR, 'series' => \PDO::PARAM_STR, 'value' => \PDO::PARAM_STR, - 'lastUsed' => DoctrineType::DATETIME); + 'lastUsed' => DoctrineType::DATETIME,); $this->conn->executeUpdate($sql, $paramValues, $paramTypes); } } diff --git a/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php b/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php index 53b1a01675..0385a1dd7f 100644 --- a/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php +++ b/src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php @@ -87,7 +87,7 @@ class EntityUserProvider implements UserProviderInterface 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 " . + "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 067935608e..175cc560b7 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/DataCollector/DoctrineDataCollectorTest.php @@ -50,7 +50,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()); @@ -64,7 +64,7 @@ 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()); @@ -72,7 +72,7 @@ class DoctrineDataCollectorTest extends \PHPUnit_Framework_TestCase $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 table2", 'params' => array(), 'types' => array(), 'executionMS' => 2), ); $c = $this->createCollector($queries); $c->collect(new Request(), new Response()); @@ -85,7 +85,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()); @@ -101,7 +101,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/Form/ChoiceList/GenericEntityChoiceListTest.php b/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/GenericEntityChoiceListTest.php index c5910195ca..e54968ed0d 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/GenericEntityChoiceListTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Form/ChoiceList/GenericEntityChoiceListTest.php @@ -201,7 +201,7 @@ class GenericEntityChoiceListTest extends \PHPUnit_Framework_TestCase $this->assertSame(array(1 => $entity1, 2 => $entity2), $choiceList->getChoices()); $this->assertEquals(array( 'group1' => array(1 => new ChoiceView($entity1, '1', 'Foo')), - 'group2' => array(2 => new ChoiceView($entity2, '2', 'Bar')) + 'group2' => array(2 => new ChoiceView($entity2, '2', 'Bar')), ), $choiceList->getRemainingViews()); } @@ -236,7 +236,7 @@ class GenericEntityChoiceListTest extends \PHPUnit_Framework_TestCase $this->assertEquals(array( 'Group1' => array(1 => new ChoiceView($item1, '1', 'Foo'), 2 => new ChoiceView($item2, '2', 'Bar')), 'Group2' => array(3 => new ChoiceView($item3, '3', 'Baz')), - 4 => new ChoiceView($item4, '4', 'Boo!') + 4 => new ChoiceView($item4, '4', 'Boo!'), ), $choiceList->getRemainingViews()); } @@ -263,7 +263,7 @@ class GenericEntityChoiceListTest extends \PHPUnit_Framework_TestCase $this->assertEquals(array( 1 => $item1, - 2 => $item2 + 2 => $item2, ), $choiceList->getChoices()); } diff --git a/src/Symfony/Bridge/Doctrine/Tests/Form/DoctrineOrmTypeGuesserTest.php b/src/Symfony/Bridge/Doctrine/Tests/Form/DoctrineOrmTypeGuesserTest.php index 82c587aaff..0cb900f6d0 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Form/DoctrineOrmTypeGuesserTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Form/DoctrineOrmTypeGuesserTest.php @@ -59,7 +59,7 @@ class DoctrineOrmTypeGuesserTest extends \PHPUnit_Framework_TestCase $classMetadata->expects($this->once())->method('hasField')->with('field')->will($this->returnValue(false)); $classMetadata->expects($this->once())->method('isAssociationWithSingleJoinColumn')->with('field')->will($this->returnValue(true)); - $mapping = array('joinColumns' => array(array('nullable'=>true))); + $mapping = array('joinColumns' => array(array('nullable' => true))); $classMetadata->expects($this->once())->method('getAssociationMapping')->with('field')->will($this->returnValue($mapping)); $return[] = array($classMetadata, new ValueGuess(false, Guess::HIGH_CONFIDENCE)); @@ -69,7 +69,7 @@ class DoctrineOrmTypeGuesserTest extends \PHPUnit_Framework_TestCase $classMetadata->expects($this->once())->method('hasField')->with('field')->will($this->returnValue(false)); $classMetadata->expects($this->once())->method('isAssociationWithSingleJoinColumn')->with('field')->will($this->returnValue(true)); - $mapping = array('joinColumns' => array(array('nullable'=>false))); + $mapping = array('joinColumns' => array(array('nullable' => false))); $classMetadata->expects($this->once())->method('getAssociationMapping')->with('field')->will($this->returnValue($mapping)); $return[] = array($classMetadata, new ValueGuess(true, Guess::HIGH_CONFIDENCE)); @@ -94,5 +94,4 @@ class DoctrineOrmTypeGuesserTest extends \PHPUnit_Framework_TestCase return new DoctrineOrmTypeGuesser($registry); } - } diff --git a/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php b/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php index bdb4013490..e7b3cfc96b 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php @@ -44,7 +44,7 @@ class EntityTypePerformanceTest extends FormPerformanceTestCase return array( new CoreExtension(), - new DoctrineOrmExtension($manager) + new DoctrineOrmExtension($manager), ); } diff --git a/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php b/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php index 329fa0ed3e..e91409574b 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypeTest.php @@ -130,7 +130,7 @@ class EntityTypeTest extends TypeTestCase 'em' => 'default', 'class' => self::SINGLE_IDENT_CLASS, 'required' => false, - 'property' => 'name' + 'property' => 'name', )); $this->assertEquals(array(1 => new ChoiceView($entity1, '1', 'Foo'), 2 => new ChoiceView($entity2, '2', 'Bar')), $field->createView()->vars['choices']); @@ -165,7 +165,7 @@ class EntityTypeTest extends TypeTestCase 'class' => self::SINGLE_IDENT_CLASS, 'required' => false, 'property' => 'name', - 'query_builder' => $qb + 'query_builder' => $qb, )); $this->assertEquals(array(1 => new ChoiceView($entity1, '1', 'Foo'), 2 => new ChoiceView($entity2, '2', 'Bar')), $field->createView()->vars['choices']); @@ -541,7 +541,7 @@ class EntityTypeTest extends TypeTestCase $this->assertEquals(array( 'Group1' => array(1 => new ChoiceView($item1, '1', 'Foo'), 2 => new ChoiceView($item2, '2', 'Bar')), 'Group2' => array(3 => new ChoiceView($item3, '3', 'Baz')), - '4' => new ChoiceView($item4, '4', 'Boo!') + '4' => new ChoiceView($item4, '4', 'Boo!'), ), $field->createView()->vars['choices']); } @@ -754,7 +754,7 @@ class EntityTypeTest extends TypeTestCase $this->factory->createNamed('name', 'entity', null, array( 'class' => self::SINGLE_IDENT_CLASS, 'required' => false, - 'property' => 'name' + 'property' => 'name', )); } diff --git a/src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php b/src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php index 0c39008d49..970a13e827 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Logger/DbalLoggerTest.php @@ -138,5 +138,4 @@ class DbalLoggerTest extends \PHPUnit_Framework_TestCase 'long' => $longString, )); } - } diff --git a/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php b/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php index 308d883b2e..da66a4b9f6 100644 --- a/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php +++ b/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php @@ -64,7 +64,7 @@ class UniqueEntityValidator extends ConstraintValidator $em = $this->registry->getManager($constraint->em); if (!$em) { - throw new ConstraintDefinitionException(sprintf('Object manager "%s" does not exist.', $constraint->em)); + throw new ConstraintDefinitionException(sprintf('Object manager "%s" does not exist.', $constraint->em)); } } else { $em = $this->registry->getManagerForClass(get_class($entity)); @@ -101,7 +101,7 @@ 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 " . + "Associated entities are not allowed to have more than one identifier field to be ". "part of a unique constraint in: ".$class->getName()."#".$fieldName ); } diff --git a/src/Symfony/Bridge/Monolog/Handler/ChromePhpHandler.php b/src/Symfony/Bridge/Monolog/Handler/ChromePhpHandler.php index 4b3cc575af..873632e696 100644 --- a/src/Symfony/Bridge/Monolog/Handler/ChromePhpHandler.php +++ b/src/Symfony/Bridge/Monolog/Handler/ChromePhpHandler.php @@ -43,7 +43,6 @@ class ChromePhpHandler extends BaseChromePhpHandler } if (!preg_match('{\bChrome/\d+[\.\d+]*\b}', $event->getRequest()->headers->get('User-Agent'))) { - $this->sendHeaders = false; $this->headers = array(); diff --git a/src/Symfony/Bridge/Monolog/Handler/FirePHPHandler.php b/src/Symfony/Bridge/Monolog/Handler/FirePHPHandler.php index 6cc2c38e1c..2d42235556 100644 --- a/src/Symfony/Bridge/Monolog/Handler/FirePHPHandler.php +++ b/src/Symfony/Bridge/Monolog/Handler/FirePHPHandler.php @@ -44,7 +44,6 @@ class FirePHPHandler extends BaseFirePHPHandler if (!preg_match('{\bFirePHP/\d+\.\d+\b}', $event->getRequest()->headers->get('User-Agent')) && !$event->getRequest()->headers->has('X-FirePHP-Version')) { - $this->sendHeaders = false; $this->headers = array(); diff --git a/src/Symfony/Bridge/Monolog/Tests/Processor/WebProcessorTest.php b/src/Symfony/Bridge/Monolog/Tests/Processor/WebProcessorTest.php index 115763412b..bfe3e515a4 100644 --- a/src/Symfony/Bridge/Monolog/Tests/Processor/WebProcessorTest.php +++ b/src/Symfony/Bridge/Monolog/Tests/Processor/WebProcessorTest.php @@ -32,7 +32,7 @@ class WebProcessorTest extends \PHPUnit_Framework_TestCase 'REMOTE_ADDR' => 'B', 'REQUEST_METHOD' => 'C', 'SERVER_NAME' => 'D', - 'HTTP_REFERER' => 'E' + 'HTTP_REFERER' => 'E', ); $request = new Request(); diff --git a/src/Symfony/Bridge/Propel1/Form/EventListener/TranslationCollectionFormListener.php b/src/Symfony/Bridge/Propel1/Form/EventListener/TranslationCollectionFormListener.php index ae39700736..9829bb238d 100644 --- a/src/Symfony/Bridge/Propel1/Form/EventListener/TranslationCollectionFormListener.php +++ b/src/Symfony/Bridge/Propel1/Form/EventListener/TranslationCollectionFormListener.php @@ -22,7 +22,6 @@ use Symfony\Component\Form\FormEvent; */ class TranslationCollectionFormListener implements EventSubscriberInterface { - private $i18nClass; private $languages; diff --git a/src/Symfony/Bridge/Propel1/Form/EventListener/TranslationFormListener.php b/src/Symfony/Bridge/Propel1/Form/EventListener/TranslationFormListener.php index 3f20102c7c..083e0ac886 100644 --- a/src/Symfony/Bridge/Propel1/Form/EventListener/TranslationFormListener.php +++ b/src/Symfony/Bridge/Propel1/Form/EventListener/TranslationFormListener.php @@ -70,7 +70,7 @@ class TranslationFormListener implements EventSubscriberInterface $customOptions = $options['options']; } $options = array( - 'label' => $label.' '.strtoupper($data->getLocale()) + 'label' => $label.' '.strtoupper($data->getLocale()), ); $options = array_merge($options, $customOptions); diff --git a/src/Symfony/Bridge/Propel1/Form/PropelExtension.php b/src/Symfony/Bridge/Propel1/Form/PropelExtension.php index 77e044b9c6..d333f79903 100644 --- a/src/Symfony/Bridge/Propel1/Form/PropelExtension.php +++ b/src/Symfony/Bridge/Propel1/Form/PropelExtension.php @@ -26,7 +26,7 @@ class PropelExtension extends AbstractExtension return array( new Type\ModelType(PropertyAccess::createPropertyAccessor()), new Type\TranslationCollectionType(), - new Type\TranslationType() + new Type\TranslationType(), ); } diff --git a/src/Symfony/Bridge/Propel1/Form/Type/TranslationCollectionType.php b/src/Symfony/Bridge/Propel1/Form/Type/TranslationCollectionType.php index 4ecf7e03be..1ed78ae705 100644 --- a/src/Symfony/Bridge/Propel1/Form/Type/TranslationCollectionType.php +++ b/src/Symfony/Bridge/Propel1/Form/Type/TranslationCollectionType.php @@ -59,7 +59,7 @@ class TranslationCollectionType extends AbstractType public function setDefaultOptions(OptionsResolverInterface $resolver) { $resolver->setRequired(array( - 'languages' + 'languages', )); $resolver->setDefaults(array( @@ -68,8 +68,8 @@ class TranslationCollectionType extends AbstractType 'allow_delete' => false, 'options' => array( 'data_class' => null, - 'columns' => null - ) + 'columns' => null, + ), )); } } diff --git a/src/Symfony/Bridge/Propel1/Form/Type/TranslationType.php b/src/Symfony/Bridge/Propel1/Form/Type/TranslationType.php index 1bd94a484c..8315b4f347 100644 --- a/src/Symfony/Bridge/Propel1/Form/Type/TranslationType.php +++ b/src/Symfony/Bridge/Propel1/Form/Type/TranslationType.php @@ -48,7 +48,7 @@ class TranslationType extends AbstractType { $resolver->setRequired(array( 'data_class', - 'columns' + 'columns', )); } } diff --git a/src/Symfony/Bridge/Propel1/Tests/DataCollector/PropelDataCollectorTest.php b/src/Symfony/Bridge/Propel1/Tests/DataCollector/PropelDataCollectorTest.php index 23d6fc9fc6..0d80b83c7a 100644 --- a/src/Symfony/Bridge/Propel1/Tests/DataCollector/PropelDataCollectorTest.php +++ b/src/Symfony/Bridge/Propel1/Tests/DataCollector/PropelDataCollectorTest.php @@ -47,9 +47,9 @@ class PropelDataCollectorTest extends Propel1TestCase array( 'sql' => "SET NAMES 'utf8'", 'time' => '0.000 sec', - 'connection'=> 'default', - 'memory' => '1.4 MB' - ) + 'connection' => 'default', + 'memory' => '1.4 MB', + ), ), $c->getQueries()); $this->assertEquals(1, $c->getQueryCount()); } @@ -69,20 +69,20 @@ class PropelDataCollectorTest extends Propel1TestCase array( 'sql' => "SET NAMES 'utf8'", 'time' => '0.000 sec', - 'connection'=> 'default', - 'memory' => '1.4 MB' + 'connection' => 'default', + '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", 'time' => '0.012 sec', - 'connection'=> 'default', - 'memory' => '2.4 MB' + 'connection' => 'default', + 'memory' => '2.4 MB', ), array( 'sql' => "INSERT INTO `table` (`some_array`) VALUES ('| 1 | 2 | 3 |')", 'time' => '0.012 sec', - 'connection'=> 'default', - 'memory' => '2.4 MB' + 'connection' => 'default', + 'memory' => '2.4 MB', ), ), $c->getQueries()); $this->assertEquals(3, $c->getQueryCount()); diff --git a/src/Symfony/Bridge/Propel1/Tests/Fixtures/ItemQuery.php b/src/Symfony/Bridge/Propel1/Tests/Fixtures/ItemQuery.php index 47f769057e..83955592a5 100644 --- a/src/Symfony/Bridge/Propel1/Tests/Fixtures/ItemQuery.php +++ b/src/Symfony/Bridge/Propel1/Tests/Fixtures/ItemQuery.php @@ -96,7 +96,7 @@ class ItemQuery return array( $mainAuthorRelation, $authorRelation, - $resellerRelation + $resellerRelation, ); } } diff --git a/src/Symfony/Bridge/Propel1/Tests/Fixtures/TranslatableItemI18n.php b/src/Symfony/Bridge/Propel1/Tests/Fixtures/TranslatableItemI18n.php index 1253b26c26..1fa1741ab5 100644 --- a/src/Symfony/Bridge/Propel1/Tests/Fixtures/TranslatableItemI18n.php +++ b/src/Symfony/Bridge/Propel1/Tests/Fixtures/TranslatableItemI18n.php @@ -94,7 +94,6 @@ class TranslatableItemI18n implements \Persistent public function setLocale($locale) { - $this->locale = $locale; } @@ -115,7 +114,6 @@ class TranslatableItemI18n implements \Persistent public function setValue($value) { - $this->value = $value; } @@ -126,7 +124,6 @@ class TranslatableItemI18n implements \Persistent public function setValue2($value2) { - $this->value2 = $value2; } diff --git a/src/Symfony/Bridge/Propel1/Tests/Form/ChoiceList/ModelChoiceListTest.php b/src/Symfony/Bridge/Propel1/Tests/Form/ChoiceList/ModelChoiceListTest.php index ef77b5edbb..9f9a69e331 100644 --- a/src/Symfony/Bridge/Propel1/Tests/Form/ChoiceList/ModelChoiceListTest.php +++ b/src/Symfony/Bridge/Propel1/Tests/Form/ChoiceList/ModelChoiceListTest.php @@ -97,7 +97,7 @@ class ModelChoiceListTest extends Propel1TestCase null, null, array( - $item1 + $item1, ) ); @@ -122,7 +122,7 @@ class ModelChoiceListTest extends Propel1TestCase $this->assertSame(array(1 => $item1, 2 => $item2), $choiceList->getChoices()); $this->assertEquals(array( 'group1' => array(1 => new ChoiceView($item1, '1', 'Foo')), - 'group2' => array(2 => new ChoiceView($item2, '2', 'Bar')) + 'group2' => array(2 => new ChoiceView($item2, '2', 'Bar')), ), $choiceList->getRemainingViews()); } @@ -150,7 +150,7 @@ class ModelChoiceListTest extends Propel1TestCase $this->assertEquals(array( 'Group1' => array(1 => new ChoiceView($item1, '1', 'Foo'), 2 => new ChoiceView($item2, '2', 'Bar')), 'Group2' => array(3 => new ChoiceView($item3, '3', 'Baz')), - 4 => new ChoiceView($item4, '4', 'Boo!') + 4 => new ChoiceView($item4, '4', 'Boo!'), ), $choiceList->getRemainingViews()); } @@ -172,7 +172,7 @@ class ModelChoiceListTest extends Propel1TestCase $this->assertEquals(array( 1 => $item1, - 2 => $item2 + 2 => $item2, ), $choiceList->getChoices()); } diff --git a/src/Symfony/Bridge/Propel1/Tests/Form/DataTransformer/CollectionToArrayTransformerTest.php b/src/Symfony/Bridge/Propel1/Tests/Form/DataTransformer/CollectionToArrayTransformerTest.php index b48652b82f..32d18404f9 100644 --- a/src/Symfony/Bridge/Propel1/Tests/Form/DataTransformer/CollectionToArrayTransformerTest.php +++ b/src/Symfony/Bridge/Propel1/Tests/Form/DataTransformer/CollectionToArrayTransformerTest.php @@ -108,4 +108,6 @@ class CollectionToArrayTransformerTest extends Propel1TestCase } } -class DummyObject {} +class DummyObject +{ +} diff --git a/src/Symfony/Bridge/Propel1/Tests/Form/Type/TranslationCollectionTypeTest.php b/src/Symfony/Bridge/Propel1/Tests/Form/Type/TranslationCollectionTypeTest.php index e9fa8395e7..0663020cc6 100644 --- a/src/Symfony/Bridge/Propel1/Tests/Form/Type/TranslationCollectionTypeTest.php +++ b/src/Symfony/Bridge/Propel1/Tests/Form/Type/TranslationCollectionTypeTest.php @@ -42,15 +42,15 @@ class TranslationCollectionTypeTest extends TypeTestCase $item->addTranslatableItemI18n(new TranslatableItemI18n(2, 'en', 'val2')); $builder = $this->factory->createBuilder('form', null, array( - 'data_class' => self::TRANSLATION_CLASS + 'data_class' => self::TRANSLATION_CLASS, )); $builder->add('translatableItemI18ns', 'propel1_translation_collection', array( 'languages' => array('en', 'fr'), 'options' => array( 'data_class' => self::TRANSLATABLE_I18N_CLASS, - 'columns' => array('value', 'value2' => array('label' => 'Label', 'type' => 'textarea')) - ) + 'columns' => array('value', 'value2' => array('label' => 'Label', 'type' => 'textarea')), + ), )); $form = $builder->getForm(); $form->setData($item); @@ -79,14 +79,14 @@ class TranslationCollectionTypeTest extends TypeTestCase $this->assertCount(0, $item->getTranslatableItemI18ns()); $builder = $this->factory->createBuilder('form', null, array( - 'data_class' => self::TRANSLATION_CLASS + 'data_class' => self::TRANSLATION_CLASS, )); $builder->add('translatableItemI18ns', 'propel1_translation_collection', array( 'languages' => array('en', 'fr'), 'options' => array( 'data_class' => self::TRANSLATABLE_I18N_CLASS, - 'columns' => array('value', 'value2' => array('label' => 'Label', 'type' => 'textarea')) - ) + 'columns' => array('value', 'value2' => array('label' => 'Label', 'type' => 'textarea')), + ), )); $form = $builder->getForm(); @@ -103,14 +103,14 @@ class TranslationCollectionTypeTest extends TypeTestCase $item = new Item(null, 'val'); $builder = $this->factory->createBuilder('form', null, array( - 'data_class' => self::NON_TRANSLATION_CLASS + 'data_class' => self::NON_TRANSLATION_CLASS, )); $builder->add('value', 'propel1_translation_collection', array( 'languages' => array('en', 'fr'), 'options' => array( 'data_class' => self::TRANSLATABLE_I18N_CLASS, - 'columns' => array('value', 'value2' => array('label' => 'Label', 'type' => 'textarea')) - ) + 'columns' => array('value', 'value2' => array('label' => 'Label', 'type' => 'textarea')), + ), )); $form = $builder->getForm(); @@ -125,8 +125,8 @@ class TranslationCollectionTypeTest extends TypeTestCase $this->factory->createNamed('itemI18ns', 'propel1_translation_collection', null, array( 'languages' => array('en', 'fr'), 'options' => array( - 'columns' => array('value', 'value2') - ) + 'columns' => array('value', 'value2'), + ), )); } @@ -138,8 +138,8 @@ class TranslationCollectionTypeTest extends TypeTestCase $this->factory->createNamed('itemI18ns', 'propel1_translation_collection', null, array( 'options' => array( 'data_class' => self::TRANSLATABLE_I18N_CLASS, - 'columns' => array('value', 'value2') - ) + 'columns' => array('value', 'value2'), + ), )); } @@ -151,8 +151,8 @@ class TranslationCollectionTypeTest extends TypeTestCase $this->factory->createNamed('itemI18ns', 'propel1_translation_collection', null, array( 'languages' => array('en', 'fr'), 'options' => array( - 'data_class' => self::TRANSLATABLE_I18N_CLASS - ) + 'data_class' => self::TRANSLATABLE_I18N_CLASS, + ), )); } } diff --git a/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/ContainerBuilderTest.php b/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/ContainerBuilderTest.php index 804c9da9c6..10faf8e12a 100644 --- a/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/ContainerBuilderTest.php +++ b/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/ContainerBuilderTest.php @@ -11,7 +11,7 @@ namespace Symfony\Bridge\ProxyManager\Tests\LazyProxy; -require_once __DIR__ . '/Fixtures/includes/foo.php'; +require_once __DIR__.'/Fixtures/includes/foo.php'; use Symfony\Bridge\ProxyManager\LazyProxy\Instantiator\RuntimeInstantiator; use Symfony\Component\DependencyInjection\ContainerBuilder; diff --git a/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Fixtures/php/lazy_service.php b/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Fixtures/php/lazy_service.php index 1b06f07af0..630c8c59fe 100644 --- a/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Fixtures/php/lazy_service.php +++ b/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Fixtures/php/lazy_service.php @@ -65,7 +65,6 @@ class LazyServiceProjectServiceContainer extends Container class stdClass_c1d194250ee2e2b7d2eab8b8212368a8 extends \stdClass implements \ProxyManager\Proxy\LazyLoadingInterface, \ProxyManager\Proxy\ValueHolderInterface { - /** * @var \Closure|null initializer responsible for generating the wrapped object */ @@ -193,5 +192,4 @@ class stdClass_c1d194250ee2e2b7d2eab8b8212368a8 extends \stdClass implements \Pr { return $this->valueHolder5157dd96e88c0; } - } diff --git a/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/ProxyDumperTest.php b/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/ProxyDumperTest.php index adbd990a74..e3ef13d8e9 100644 --- a/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/ProxyDumperTest.php +++ b/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/ProxyDumperTest.php @@ -57,7 +57,7 @@ class ProxyDumperTest extends \PHPUnit_Framework_TestCase $this->assertStringMatchesFormat( '%Aclass SymfonyBridgeProxyManagerTestsLazyProxyPhpDumperProxyDumperTest%aextends%w' - . '\Symfony\Bridge\ProxyManager\Tests\LazyProxy\PhpDumper\ProxyDumperTest%a', + .'\Symfony\Bridge\ProxyManager\Tests\LazyProxy\PhpDumper\ProxyDumperTest%a', $code ); } @@ -72,10 +72,10 @@ class ProxyDumperTest extends \PHPUnit_Framework_TestCase $this->assertStringMatchesFormat( '%wif ($lazyLoad) {%w$container = $this;%wreturn $this->services[\'foo\'] = new ' - . 'SymfonyBridgeProxyManagerTestsLazyProxyPhpDumperProxyDumperTest_%s(%wfunction ' - . '(&$wrappedInstance, \ProxyManager\Proxy\LazyLoadingInterface $proxy) use ($container) {' - . '%w$wrappedInstance = $container->getFooService(false);%w$proxy->setProxyInitializer(null);' - . '%wreturn true;%w}%w);%w}%w', + .'SymfonyBridgeProxyManagerTestsLazyProxyPhpDumperProxyDumperTest_%s(%wfunction ' + .'(&$wrappedInstance, \ProxyManager\Proxy\LazyLoadingInterface $proxy) use ($container) {' + .'%w$wrappedInstance = $container->getFooService(false);%w$proxy->setProxyInitializer(null);' + .'%wreturn true;%w}%w);%w}%w', $code ); } @@ -88,7 +88,7 @@ class ProxyDumperTest extends \PHPUnit_Framework_TestCase $definitions = array( array(new Definition(__CLASS__), true), array(new Definition('stdClass'), true), - array(new Definition('foo' . uniqid()), false), + array(new Definition('foo'.uniqid()), false), array(new Definition(), false), ); diff --git a/src/Symfony/Bridge/Twig/Node/FormThemeNode.php b/src/Symfony/Bridge/Twig/Node/FormThemeNode.php index 329ab86fe0..c3ebd51bbc 100644 --- a/src/Symfony/Bridge/Twig/Node/FormThemeNode.php +++ b/src/Symfony/Bridge/Twig/Node/FormThemeNode.php @@ -35,6 +35,5 @@ class FormThemeNode extends \Twig_Node ->raw(', ') ->subcompile($this->getNode('resources')) ->raw(");\n"); - ; } } diff --git a/src/Symfony/Bridge/Twig/Node/RenderBlockNode.php b/src/Symfony/Bridge/Twig/Node/RenderBlockNode.php index 822a27279f..457532ecd5 100644 --- a/src/Symfony/Bridge/Twig/Node/RenderBlockNode.php +++ b/src/Symfony/Bridge/Twig/Node/RenderBlockNode.php @@ -29,7 +29,7 @@ class RenderBlockNode extends \Twig_Node_Expression_Function if (isset($arguments[0])) { $compiler->subcompile($arguments[0]); - $compiler->raw(', \'' . $this->getAttribute('name') . '\''); + $compiler->raw(', \''.$this->getAttribute('name').'\''); if (isset($arguments[1])) { $compiler->raw(', '); diff --git a/src/Symfony/Bridge/Twig/Tests/Extension/CodeExtensionTest.php b/src/Symfony/Bridge/Twig/Tests/Extension/CodeExtensionTest.php index d935651439..5e4a9a3079 100644 --- a/src/Symfony/Bridge/Twig/Tests/Extension/CodeExtensionTest.php +++ b/src/Symfony/Bridge/Twig/Tests/Extension/CodeExtensionTest.php @@ -53,7 +53,7 @@ class CodeExtensionTest extends \PHPUnit_Framework_TestCase array('F\Q\N\Foo::Method', 'Foo::Method()'), array('Bare::Method', 'Bare::Method()'), array('Closure', 'Closure'), - array('Method', 'Method()') + array('Method', 'Method()'), ); } diff --git a/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionDivLayoutTest.php b/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionDivLayoutTest.php index 5eb67ea730..f0e2cb3f88 100644 --- a/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionDivLayoutTest.php +++ b/src/Symfony/Bridge/Twig/Tests/Extension/FormExtensionDivLayoutTest.php @@ -210,14 +210,14 @@ class FormExtensionDivLayoutTest extends AbstractDivLayoutTest public static function themeBlockInheritanceProvider() { return array( - array(array('theme.html.twig')) + array(array('theme.html.twig')), ); } public static function themeInheritanceProvider() { return array( - array(array('parent_label.html.twig'), array('child_label.html.twig')) + array(array('parent_label.html.twig'), array('child_label.html.twig')), ); } } diff --git a/src/Symfony/Bridge/Twig/Tests/Extension/TranslationExtensionTest.php b/src/Symfony/Bridge/Twig/Tests/Extension/TranslationExtensionTest.php index 11c2d5ad79..a75f228860 100644 --- a/src/Symfony/Bridge/Twig/Tests/Extension/TranslationExtensionTest.php +++ b/src/Symfony/Bridge/Twig/Tests/Extension/TranslationExtensionTest.php @@ -101,17 +101,17 @@ class TranslationExtensionTest extends TestCase // transchoice array('{% transchoice count from "messages" %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}', - 'There is no apples', array('count' => 0)), + 'There is no apples', array('count' => 0),), array('{% transchoice count %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}', - 'There is 5 apples', array('count' => 5)), + 'There is 5 apples', array('count' => 5),), array('{% transchoice count %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtranschoice %}', - 'There is 5 apples (Symfony2)', array('count' => 5, 'name' => 'Symfony2')), + 'There is 5 apples (Symfony2)', array('count' => 5, 'name' => 'Symfony2'),), array('{% transchoice count with { \'%name%\': \'Symfony2\' } %}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples (%name%){% endtranschoice %}', - 'There is 5 apples (Symfony2)', array('count' => 5)), + 'There is 5 apples (Symfony2)', array('count' => 5),), array('{% transchoice count into "fr"%}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}', - 'There is no apples', array('count' => 0)), + 'There is no apples', array('count' => 0),), array('{% transchoice 5 into "fr"%}{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples{% endtranschoice %}', - 'There is 5 apples'), + 'There is 5 apples',), // trans filter array('{{ "Hello"|trans }}', 'Hello'), diff --git a/src/Symfony/Bridge/Twig/Tests/Node/FormThemeTest.php b/src/Symfony/Bridge/Twig/Tests/Node/FormThemeTest.php index ffbec162d6..7b2cd4f999 100644 --- a/src/Symfony/Bridge/Twig/Tests/Node/FormThemeTest.php +++ b/src/Symfony/Bridge/Twig/Tests/Node/FormThemeTest.php @@ -21,7 +21,7 @@ class FormThemeTest extends TestCase $form = new \Twig_Node_Expression_Name('form', 0); $resources = new \Twig_Node(array( new \Twig_Node_Expression_Constant('tpl1', 0), - new \Twig_Node_Expression_Constant('tpl2', 0) + new \Twig_Node_Expression_Constant('tpl2', 0), )); $node = new FormThemeNode($form, $resources, 0); @@ -37,7 +37,7 @@ class FormThemeTest extends TestCase new \Twig_Node_Expression_Constant(0, 0), new \Twig_Node_Expression_Constant('tpl1', 0), new \Twig_Node_Expression_Constant(1, 0), - new \Twig_Node_Expression_Constant('tpl2', 0) + new \Twig_Node_Expression_Constant('tpl2', 0), ), 0); $node = new FormThemeNode($form, $resources, 0); diff --git a/src/Symfony/Bridge/Twig/Tests/TokenParser/FormThemeTokenParserTest.php b/src/Symfony/Bridge/Twig/Tests/TokenParser/FormThemeTokenParserTest.php index 1559df1cc3..c844239e53 100644 --- a/src/Symfony/Bridge/Twig/Tests/TokenParser/FormThemeTokenParserTest.php +++ b/src/Symfony/Bridge/Twig/Tests/TokenParser/FormThemeTokenParserTest.php @@ -43,7 +43,7 @@ class FormThemeTokenParserTest extends TestCase ), 1), 1, 'form_theme' - ) + ), ), array( '{% form_theme form "tpl1" "tpl2" %}', @@ -53,11 +53,11 @@ class FormThemeTokenParserTest extends TestCase new \Twig_Node_Expression_Constant(0, 1), new \Twig_Node_Expression_Constant('tpl1', 1), new \Twig_Node_Expression_Constant(1, 1), - new \Twig_Node_Expression_Constant('tpl2', 1) + new \Twig_Node_Expression_Constant('tpl2', 1), ), 1), 1, 'form_theme' - ) + ), ), array( '{% form_theme form with "tpl1" %}', @@ -66,7 +66,7 @@ class FormThemeTokenParserTest extends TestCase new \Twig_Node_Expression_Constant('tpl1', 1), 1, 'form_theme' - ) + ), ), array( '{% form_theme form with ["tpl1"] %}', @@ -78,7 +78,7 @@ class FormThemeTokenParserTest extends TestCase ), 1), 1, 'form_theme' - ) + ), ), array( '{% form_theme form with ["tpl1", "tpl2"] %}', @@ -88,11 +88,11 @@ class FormThemeTokenParserTest extends TestCase new \Twig_Node_Expression_Constant(0, 1), new \Twig_Node_Expression_Constant('tpl1', 1), new \Twig_Node_Expression_Constant(1, 1), - new \Twig_Node_Expression_Constant('tpl2', 1) + new \Twig_Node_Expression_Constant('tpl2', 1), ), 1), 1, 'form_theme' - ) + ), ), ); } diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php index f9e2d403c3..bf118407b0 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php @@ -32,7 +32,7 @@ class ConfigDumpReferenceCommand extends ContainerDebugCommand $this ->setName('config:dump-reference') ->setDefinition(array( - new InputArgument('name', InputArgument::OPTIONAL, 'The Bundle or extension alias') + new InputArgument('name', InputArgument::OPTIONAL, 'The Bundle or extension alias'), )) ->setDescription('Dumps default configuration for an extension') ->setHelp(<<setDescription('Displays current services for an application') ->setHelp(<<setDescription('Updates the translation file') ->setHelp(<<getRequirements() as $name => $value) { - $route->setRequirement($name, $this->resolve($value)); + $route->setRequirement($name, $this->resolve($value)); } $route->setPath($this->resolve($route->getPath())); @@ -138,7 +138,7 @@ class Router extends BaseRouter implements WarmableInterface } throw new RuntimeException(sprintf( - 'The container parameter "%s", used in the route configuration value "%s", ' . + 'The container parameter "%s", used in the route configuration value "%s", '. 'must be a string or numeric, but it is of type %s.', $match[1], $value, diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/TemplateFinderTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/TemplateFinderTest.php index 4b426f2562..59a7d1d920 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/TemplateFinderTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/CacheWarmer/TemplateFinderTest.php @@ -53,5 +53,4 @@ class TemplateFinderTest extends TestCase $this->assertContains('::this.is.a.template.format.engine', $templates); $this->assertContains('::resource.format.engine', $templates); } - } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/RedirectControllerTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/RedirectControllerTest.php index 34d1eeac28..a892c711a3 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/RedirectControllerTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Controller/RedirectControllerTest.php @@ -60,7 +60,7 @@ class RedirectControllerTest extends TestCase 'route' => $route, 'permanent' => $permanent, 'additional-parameter' => 'value', - 'ignoreAttributes' => $ignoreAttributes + 'ignoreAttributes' => $ignoreAttributes, ), ); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddCacheWarmerPassTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddCacheWarmerPassTest.php index 03eacc3636..2f39190a8f 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddCacheWarmerPassTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/AddCacheWarmerPassTest.php @@ -23,7 +23,7 @@ class AddCacheWarmerPassTest extends \PHPUnit_Framework_TestCase $services = array( 'my_cache_warmer_service1' => array(0 => array('priority' => 100)), 'my_cache_warmer_service2' => array(0 => array('priority' => 200)), - 'my_cache_warmer_service3' => array() + 'my_cache_warmer_service3' => array(), ); $definition = $this->getMock('Symfony\Component\DependencyInjection\Definition'); @@ -46,7 +46,7 @@ class AddCacheWarmerPassTest extends \PHPUnit_Framework_TestCase ->with(0, array( new Reference('my_cache_warmer_service2'), new Reference('my_cache_warmer_service1'), - new Reference('my_cache_warmer_service3') + new Reference('my_cache_warmer_service3'), )); $addCacheWarmerPass = new AddCacheWarmerPass(); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/SerializerPassTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/SerializerPassTest.php index aa276b1e04..021ecd0bbc 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/SerializerPassTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/SerializerPassTest.php @@ -22,7 +22,6 @@ use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\SerializerPass; */ class SerializerPassTest extends \PHPUnit_Framework_TestCase { - public function testThrowExceptionWhenNoNormalizers() { $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder'); @@ -72,16 +71,16 @@ class SerializerPassTest extends \PHPUnit_Framework_TestCase public function testServicesAreOrderedAccordingToPriority() { - $services = array( + $services = array( 'n3' => array('tag' => array()), 'n1' => array('tag' => array('priority' => 200)), - 'n2' => array('tag' => array('priority' => 100)) + 'n2' => array('tag' => array('priority' => 100)), ); - $expected = array( + $expected = array( new Reference('n1'), new Reference('n2'), - new Reference('n3') + new Reference('n3'), ); $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder'); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/TranslatorPassTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/TranslatorPassTest.php index 871acb2525..b68ea4e0d0 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/TranslatorPassTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/TranslatorPassTest.php @@ -40,8 +40,6 @@ class TranslatorPassTest extends \PHPUnit_Framework_TestCase $container->expects($this->once()) ->method('findDefinition') ->will($this->returnValue($this->getMock('Symfony\Component\DependencyInjection\Definition'))); - ; - $pass = new TranslatorPass(); $pass->process($container); } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php index 939703d8ab..1bcf1debf0 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php @@ -36,7 +36,7 @@ class ConfigurationTest extends \PHPUnit_Framework_TestCase $configuration = new Configuration(); $config = $processor->processConfiguration($configuration, array(array( 'secret' => 's3cr3t', - 'trusted_proxies' => $trustedProxies + 'trusted_proxies' => $trustedProxies, ))); $this->assertEquals($processedProxies, $config['trusted_proxies']); @@ -66,8 +66,8 @@ class ConfigurationTest extends \PHPUnit_Framework_TestCase $processor->processConfiguration($configuration, array( array( 'secret' => 's3cr3t', - 'trusted_proxies' => 'Not an IP address' - ) + 'trusted_proxies' => 'Not an IP address', + ), )); } @@ -81,8 +81,8 @@ class ConfigurationTest extends \PHPUnit_Framework_TestCase $processor->processConfiguration($configuration, array( array( 'secret' => 's3cr3t', - 'trusted_proxies' => array('Not an IP address') - ) + 'trusted_proxies' => array('Not an IP address'), + ), )); } @@ -128,8 +128,8 @@ class ConfigurationTest extends \PHPUnit_Framework_TestCase 'debug' => '%kernel.debug%', ), 'serializer' => array( - 'enabled' => false - ) + 'enabled' => false, + ), ); } } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/TestBundle/TestBundle.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/TestBundle/TestBundle.php index e936bfd98e..b0c4548fa0 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/TestBundle/TestBundle.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/TestBundle/TestBundle.php @@ -13,5 +13,4 @@ namespace Symfony\Bundle\FrameworkBundle\Tests; class TestBundle extends \Symfony\Component\HttpKernel\Bundle\Bundle { - } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php index 0bc94f2e73..801f61b94e 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php @@ -54,7 +54,7 @@ $container->loadFromExtension('framework', array( ), ), 'form' => array( - 'resources' => array('theme1', 'theme2') + 'resources' => array('theme1', 'theme2'), ), 'hinclude_default_template' => 'global_hinclude_template', ), @@ -71,5 +71,5 @@ $container->loadFromExtension('framework', array( 'debug' => true, 'file_cache_dir' => '%kernel.cache_dir%/annotations', ), - 'ide' => 'file%%link%%format' + 'ide' => 'file%%link%%format', )); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php index f1adb72976..df4983d7ff 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php @@ -185,19 +185,19 @@ abstract class FrameworkExtensionTest extends TestCase $files = array_map(function ($resource) { return realpath($resource[1]); }, $resources); $ref = new \ReflectionClass('Symfony\Component\Validator\Validator'); $this->assertContains( - strtr(dirname($ref->getFileName()) . '/Resources/translations/validators.en.xlf', '/', DIRECTORY_SEPARATOR), + strtr(dirname($ref->getFileName()).'/Resources/translations/validators.en.xlf', '/', DIRECTORY_SEPARATOR), $files, '->registerTranslatorConfiguration() finds Validator translation resources' ); $ref = new \ReflectionClass('Symfony\Component\Form\Form'); $this->assertContains( - strtr(dirname($ref->getFileName()) . '/Resources/translations/validators.en.xlf', '/', DIRECTORY_SEPARATOR), + strtr(dirname($ref->getFileName()).'/Resources/translations/validators.en.xlf', '/', DIRECTORY_SEPARATOR), $files, '->registerTranslatorConfiguration() finds Form translation resources' ); $ref = new \ReflectionClass('Symfony\Component\Security\Core\SecurityContext'); $this->assertContains( - strtr(dirname(dirname($ref->getFileName())) . '/Resources/translations/security.en.xlf', '/', DIRECTORY_SEPARATOR), + strtr(dirname(dirname($ref->getFileName())).'/Resources/translations/security.en.xlf', '/', DIRECTORY_SEPARATOR), $files, '->registerTranslatorConfiguration() finds Security translation resources' ); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/SessionController.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/SessionController.php index 8d395760e8..96bc067fe5 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/SessionController.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/SessionController.php @@ -17,7 +17,7 @@ use Symfony\Component\DependencyInjection\ContainerAware; class SessionController extends ContainerAware { - public function welcomeAction($name=null) + public function welcomeAction($name = null) { $request = $this->container->get('request'); $session = $request->getSession(); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Routing/RouterTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Routing/RouterTest.php index 2cc57d1a73..bc44b78a18 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Routing/RouterTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Routing/RouterTest.php @@ -24,7 +24,7 @@ class RouterTest extends \PHPUnit_Framework_TestCase $routes->add('foo', new Route( ' /{_locale}', array( - '_locale' => '%locale%' + '_locale' => '%locale%', ), array( '_locale' => 'en|es', diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperDivLayoutTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperDivLayoutTest.php index 9a960e3bea..70df59acbe 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperDivLayoutTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/Helper/FormHelperDivLayoutTest.php @@ -125,14 +125,14 @@ class FormHelperDivLayoutTest extends AbstractDivLayoutTest public static function themeBlockInheritanceProvider() { return array( - array(array('TestBundle:Parent')) + array(array('TestBundle:Parent')), ); } public static function themeInheritanceProvider() { return array( - array(array('TestBundle:Parent'), array('TestBundle:Child')) + array(array('TestBundle:Parent'), array('TestBundle:Child')), ); } } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/TranslatorTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/TranslatorTest.php index a93dd5e845..68ad018a68 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/TranslatorTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/TranslatorTest.php @@ -183,7 +183,6 @@ class TranslatorTest extends \PHPUnit_Framework_TestCase $this->assertSame('en-US', $translator->getLocale()); } - protected function getCatalogue($locale, $messages) { $catalogue = new MessageCatalogue($locale); diff --git a/src/Symfony/Bundle/FrameworkBundle/Translation/PhpStringTokenParser.php b/src/Symfony/Bundle/FrameworkBundle/Translation/PhpStringTokenParser.php index 0b29792e52..34d079069b 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Translation/PhpStringTokenParser.php +++ b/src/Symfony/Bundle/FrameworkBundle/Translation/PhpStringTokenParser.php @@ -96,7 +96,7 @@ class PhpStringTokenParser public static function parseEscapeSequences($str, $quote) { if (null !== $quote) { - $str = str_replace('\\' . $quote, $quote, $str); + $str = str_replace('\\'.$quote, $quote, $str); } return preg_replace_callback( diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php index 95f1ced93d..97d1d3d962 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php @@ -309,11 +309,11 @@ class MainConfiguration implements ConfigurationInterface 'memory' => array( 'users' => array( 'foo' => array('password' => 'foo', 'roles' => 'ROLE_USER'), - 'bar' => array('password' => 'bar', 'roles' => '[ROLE_USER, ROLE_ADMIN]') + 'bar' => array('password' => 'bar', 'roles' => '[ROLE_USER, ROLE_ADMIN]'), ), - ) + ), ), - 'my_entity_provider' => array('entity' => array('class' => 'SecurityBundle:User', 'property' => 'username')) + 'my_entity_provider' => array('entity' => array('class' => 'SecurityBundle:User', 'property' => 'username')), )) ->disallowNewKeysInSubsequentConfigs() ->isRequired() @@ -370,8 +370,8 @@ class MainConfiguration implements ConfigurationInterface 'Acme\DemoBundle\Entity\User2' => array( 'algorithm' => 'sha512', 'encode_as_base64' => 'true', - 'iterations'=> 5000 - ) + 'iterations' => 5000, + ), )) ->requiresAtLeastOneElement() ->useAttributeAsKey('class') diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php index 288ea1e824..e7fb75773c 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php @@ -61,7 +61,7 @@ class RememberMeFactory implements SecurityFactoryInterface if (isset($config['token_provider'])) { $rememberMeServices->addMethodCall('setTokenProvider', array( - new Reference($config['token_provider']) + new Reference($config['token_provider']), )); } diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php index dce37e48b8..17f16c0293 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php @@ -136,7 +136,7 @@ class SecurityExtension extends Extension ->addTag('doctrine.event_listener', array( 'connection' => $config['connection'], 'event' => 'postGenerateSchema', - 'lazy' => true + 'lazy' => true, )) ; diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/custom_acl_provider.php b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/custom_acl_provider.php index 4acf6cc960..351dc6c09e 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/custom_acl_provider.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/custom_acl_provider.php @@ -5,5 +5,5 @@ $this->load('container1.php', $container); $container->loadFromExtension('security', array( 'acl' => array( 'provider' => 'foo', - ) + ), )); diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/merge.php b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/merge.php index 82966dccc2..50ef504ea4 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/merge.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/merge.php @@ -16,5 +16,5 @@ $container->loadFromExtension('security', array( 'role_hierarchy' => array( 'FOO' => array('MOO'), - ) + ), )); diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/merge_import.php b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/merge_import.php index 1e29d40e28..912b9127ef 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/merge_import.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/merge_import.php @@ -5,8 +5,8 @@ $container->loadFromExtension('security', array( 'main' => array( 'form_login' => array( 'login_path' => '/login', - ) - ) + ), + ), ), 'role_hierarchy' => array( 'FOO' => 'BAR', diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php index 0605a1619e..b91244d24a 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php @@ -35,9 +35,9 @@ class SecurityExtensionTest extends \PHPUnit_Framework_TestCase 'pattern' => '/secured_area/.*', 'form_login' => array( 'check_path' => '/some_area/login_check', - ) - ) - ) + ), + ), + ), )); $container->compile(); @@ -59,8 +59,8 @@ class SecurityExtensionTest extends \PHPUnit_Framework_TestCase 'firewalls' => array( 'some_firewall' => array( 'pattern' => '/.*', - ) - ) + ), + ), )); $container->compile(); diff --git a/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php b/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php index e8fec8ddc4..3f1e0176b3 100644 --- a/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php +++ b/src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php @@ -42,7 +42,7 @@ class TwigExtension extends Extension if (is_array($value) && isset($value['key'])) { $config['globals'][$name] = array( 'key' => $name, - 'value' => $config['globals'][$name] + 'value' => $config['globals'][$name], ); } } diff --git a/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/php/full.php b/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/php/full.php index 3d2a14d00d..c6d506e86a 100644 --- a/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/php/full.php +++ b/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/Fixtures/php/full.php @@ -4,7 +4,7 @@ $container->loadFromExtension('twig', array( 'form' => array( 'resources' => array( 'MyBundle::form.html.twig', - ) + ), ), 'globals' => array( 'foo' => '@bar', diff --git a/src/Symfony/Bundle/TwigBundle/Tests/TokenParser/RenderTokenParserTest.php b/src/Symfony/Bundle/TwigBundle/Tests/TokenParser/RenderTokenParserTest.php index 9823a98fca..55ebcd2566 100644 --- a/src/Symfony/Bundle/TwigBundle/Tests/TokenParser/RenderTokenParserTest.php +++ b/src/Symfony/Bundle/TwigBundle/Tests/TokenParser/RenderTokenParserTest.php @@ -40,7 +40,7 @@ class RenderTokenParserTest extends TestCase new \Twig_Node_Expression_Array(array(), 1), 1, 'render' - ) + ), ), array( '{% render "foo", {foo: 1} %}', @@ -52,7 +52,7 @@ class RenderTokenParserTest extends TestCase ), 1), 1, 'render' - ) + ), ), ); } diff --git a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php index dea4f8883f..2efb84a14d 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php @@ -148,7 +148,7 @@ class ProfilerController $this->profiler->disable(); return new Response($this->twig->render('@WebProfiler/Profiler/info.html.twig', array( - 'about' => $about + 'about' => $about, )), 200, array('Content-Type' => 'text/html')); } diff --git a/src/Symfony/Bundle/WebProfilerBundle/Tests/Command/ExportCommandTest.php b/src/Symfony/Bundle/WebProfilerBundle/Tests/Command/ExportCommandTest.php index 572e9b3978..70267ecc9e 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Tests/Command/ExportCommandTest.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Tests/Command/ExportCommandTest.php @@ -13,7 +13,6 @@ namespace Symfony\Bundle\WebProfilerBundle\Tests\Command; use Symfony\Bundle\WebProfilerBundle\Command\ExportCommand; use Symfony\Component\Console\Tester\CommandTester; -use Symfony\Component\Console\Application; use Symfony\Component\HttpKernel\Profiler\Profile; class ExportCommandTest extends \PHPUnit_Framework_TestCase diff --git a/src/Symfony/Bundle/WebProfilerBundle/Tests/Command/ImportCommandTest.php b/src/Symfony/Bundle/WebProfilerBundle/Tests/Command/ImportCommandTest.php index f5121c12d6..fe3ba421ad 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Tests/Command/ImportCommandTest.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Tests/Command/ImportCommandTest.php @@ -13,7 +13,6 @@ namespace Symfony\Bundle\WebProfilerBundle\Tests\Command; use Symfony\Bundle\WebProfilerBundle\Command\ImportCommand; use Symfony\Component\Console\Tester\CommandTester; -use Symfony\Component\Console\Application; use Symfony\Component\HttpKernel\Profiler\Profile; class ImportCommandTest extends \PHPUnit_Framework_TestCase diff --git a/src/Symfony/Bundle/WebProfilerBundle/Tests/Profiler/TemplateManagerTest.php b/src/Symfony/Bundle/WebProfilerBundle/Tests/Profiler/TemplateManagerTest.php index c46ca055a3..54833e7717 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Tests/Profiler/TemplateManagerTest.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Tests/Profiler/TemplateManagerTest.php @@ -48,9 +48,9 @@ class TemplateManagerTest extends TestCase $profiler = $this->mockProfiler(); $twigEnvironment = $this->mockTwigEnvironment(); $templates = array( - 'data_collector.foo'=>array('foo','FooBundle:Collector:foo'), - 'data_collector.bar'=>array('bar','FooBundle:Collector:bar'), - 'data_collector.baz'=>array('baz','FooBundle:Collector:baz') + 'data_collector.foo' => array('foo','FooBundle:Collector:foo'), + 'data_collector.bar' => array('bar','FooBundle:Collector:bar'), + 'data_collector.baz' => array('baz','FooBundle:Collector:baz'), ); $this->templateManager = new TemplateManager($profiler, $twigEnvironment, $templates); diff --git a/src/Symfony/Component/BrowserKit/Tests/ClientTest.php b/src/Symfony/Component/BrowserKit/Tests/ClientTest.php index 39015d2cc5..c14bea0096 100644 --- a/src/Symfony/Component/BrowserKit/Tests/ClientTest.php +++ b/src/Symfony/Component/BrowserKit/Tests/ClientTest.php @@ -498,7 +498,7 @@ class ClientTest extends \PHPUnit_Framework_TestCase 'HTTP_HOST' => 'www.example.com:8080', 'HTTP_USER_AGENT' => 'Symfony2 BrowserKit', 'HTTPS' => false, - 'HTTP_REFERER' => 'http://www.example.com:8080/' + 'HTTP_REFERER' => 'http://www.example.com:8080/', ); $client = new TestClient(); @@ -636,7 +636,7 @@ class ClientTest extends \PHPUnit_Framework_TestCase 'HTTP_HOST' => 'testhost', 'HTTP_USER_AGENT' => 'testua', 'HTTPS' => false, - 'NEW_SERVER_KEY' => 'new-server-key-value' + 'NEW_SERVER_KEY' => 'new-server-key-value', )); $this->assertEquals('localhost', $client->getServerParameter('HTTP_HOST')); diff --git a/src/Symfony/Component/BrowserKit/Tests/ResponseTest.php b/src/Symfony/Component/BrowserKit/Tests/ResponseTest.php index 878752c75e..23662dc54b 100644 --- a/src/Symfony/Component/BrowserKit/Tests/ResponseTest.php +++ b/src/Symfony/Component/BrowserKit/Tests/ResponseTest.php @@ -61,13 +61,13 @@ class ResponseTest extends \PHPUnit_Framework_TestCase { $headers = array( 'content-type' => 'text/html; charset=utf-8', - 'set-cookie' => array('foo=bar', 'bar=foo') + 'set-cookie' => array('foo=bar', 'bar=foo'), ); $expected = 'content-type: text/html; charset=utf-8'."\n"; - $expected.= 'set-cookie: foo=bar'."\n"; - $expected.= 'set-cookie: bar=foo'."\n\n"; - $expected.= 'foo'; + $expected .= 'set-cookie: foo=bar'."\n"; + $expected .= 'set-cookie: bar=foo'."\n\n"; + $expected .= 'foo'; $response = new Response('foo', 304, $headers); diff --git a/src/Symfony/Component/ClassLoader/ClassMapGenerator.php b/src/Symfony/Component/ClassLoader/ClassMapGenerator.php index 7f83dbc559..efc95ec8be 100644 --- a/src/Symfony/Component/ClassLoader/ClassMapGenerator.php +++ b/src/Symfony/Component/ClassLoader/ClassMapGenerator.php @@ -71,7 +71,6 @@ class ClassMapGenerator foreach ($classes as $class) { $map[$class] = $path; } - } return $map; diff --git a/src/Symfony/Component/ClassLoader/Tests/ApcUniversalClassLoaderTest.php b/src/Symfony/Component/ClassLoader/Tests/ApcUniversalClassLoaderTest.php index 38a17f2845..9755256c79 100644 --- a/src/Symfony/Component/ClassLoader/Tests/ApcUniversalClassLoaderTest.php +++ b/src/Symfony/Component/ClassLoader/Tests/ApcUniversalClassLoaderTest.php @@ -55,13 +55,13 @@ class ApcUniversalClassLoaderTest extends \PHPUnit_Framework_TestCase $this->assertTrue(class_exists($className), $message); } - public function getLoadClassTests() - { - return array( + public function getLoadClassTests() + { + return array( array('\\Apc\\Namespaced\\Foo', 'Apc\\Namespaced\\Foo', '->loadClass() loads Apc\Namespaced\Foo class'), array('Apc_Pearlike_Foo', 'Apc_Pearlike_Foo', '->loadClass() loads Apc_Pearlike_Foo class'), ); - } + } /** * @dataProvider getLoadClassFromFallbackTests @@ -77,15 +77,15 @@ class ApcUniversalClassLoaderTest extends \PHPUnit_Framework_TestCase $this->assertTrue(class_exists($className), $message); } - public function getLoadClassFromFallbackTests() - { - return array( + public function getLoadClassFromFallbackTests() + { + return array( array('\\Apc\\Namespaced\\Baz', 'Apc\\Namespaced\\Baz', '->loadClass() loads Apc\Namespaced\Baz class'), array('Apc_Pearlike_Baz', 'Apc_Pearlike_Baz', '->loadClass() loads Apc_Pearlike_Baz class'), array('\\Apc\\Namespaced\\FooBar', 'Apc\\Namespaced\\FooBar', '->loadClass() loads Apc\Namespaced\Baz class from fallback dir'), array('Apc_Pearlike_FooBar', 'Apc_Pearlike_FooBar', '->loadClass() loads Apc_Pearlike_Baz class from fallback dir'), ); - } + } /** * @dataProvider getLoadClassNamespaceCollisionTests @@ -100,9 +100,9 @@ class ApcUniversalClassLoaderTest extends \PHPUnit_Framework_TestCase $this->assertTrue(class_exists($className), $message); } - public function getLoadClassNamespaceCollisionTests() - { - return array( + public function getLoadClassNamespaceCollisionTests() + { + return array( array( array( 'Apc\\NamespaceCollision\\A' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha', @@ -136,7 +136,7 @@ class ApcUniversalClassLoaderTest extends \PHPUnit_Framework_TestCase '->loadClass() loads NamespaceCollision\A\B\Bar from beta.', ), ); - } + } /** * @dataProvider getLoadClassPrefixCollisionTests @@ -150,9 +150,9 @@ class ApcUniversalClassLoaderTest extends \PHPUnit_Framework_TestCase $this->assertTrue(class_exists($className), $message); } - public function getLoadClassPrefixCollisionTests() - { - return array( + public function getLoadClassPrefixCollisionTests() + { + return array( array( array( 'ApcPrefixCollision_A_' => __DIR__.DIRECTORY_SEPARATOR.'Fixtures/Apc/alpha/Apc', @@ -186,5 +186,5 @@ class ApcUniversalClassLoaderTest extends \PHPUnit_Framework_TestCase '->loadClass() loads ApcPrefixCollision_A_B_Bar from beta.', ), ); - } + } } diff --git a/src/Symfony/Component/ClassLoader/Tests/ClassMapGeneratorTest.php b/src/Symfony/Component/ClassLoader/Tests/ClassMapGeneratorTest.php index 18f64f7588..596844d9c9 100644 --- a/src/Symfony/Component/ClassLoader/Tests/ClassMapGeneratorTest.php +++ b/src/Symfony/Component/ClassLoader/Tests/ClassMapGeneratorTest.php @@ -76,7 +76,7 @@ class ClassMapGeneratorTest extends \PHPUnit_Framework_TestCase 'Namespaced\\Foo' => realpath(__DIR__).'/Fixtures/Namespaced/Foo.php', 'Namespaced\\Baz' => realpath(__DIR__).'/Fixtures/Namespaced/Baz.php', 'Namespaced\\WithComments' => realpath(__DIR__).'/Fixtures/Namespaced/WithComments.php', - ) + ), ), array(__DIR__.'/Fixtures/beta/NamespaceCollision', array( 'NamespaceCollision\\A\\B\\Bar' => realpath(__DIR__).'/Fixtures/beta/NamespaceCollision/A/B/Bar.php', diff --git a/src/Symfony/Component/ClassLoader/Tests/Fixtures/ClassesWithParents/A.php b/src/Symfony/Component/ClassLoader/Tests/Fixtures/ClassesWithParents/A.php index dff891dcb7..b0f9425950 100644 --- a/src/Symfony/Component/ClassLoader/Tests/Fixtures/ClassesWithParents/A.php +++ b/src/Symfony/Component/ClassLoader/Tests/Fixtures/ClassesWithParents/A.php @@ -2,4 +2,6 @@ namespace ClassesWithParents; -class A extends B {} +class A extends B +{ +} diff --git a/src/Symfony/Component/ClassLoader/Tests/Fixtures/ClassesWithParents/B.php b/src/Symfony/Component/ClassLoader/Tests/Fixtures/ClassesWithParents/B.php index 196bf7a2d3..22c751a7e5 100644 --- a/src/Symfony/Component/ClassLoader/Tests/Fixtures/ClassesWithParents/B.php +++ b/src/Symfony/Component/ClassLoader/Tests/Fixtures/ClassesWithParents/B.php @@ -2,4 +2,6 @@ namespace ClassesWithParents; -class B implements CInterface {} +class B implements CInterface +{ +} diff --git a/src/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/SomeClass.php b/src/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/SomeClass.php index 26fabbd96e..c63cef9233 100644 --- a/src/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/SomeClass.php +++ b/src/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/SomeClass.php @@ -13,5 +13,4 @@ namespace ClassMap; class SomeClass extends SomeParent implements SomeInterface { - } diff --git a/src/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/SomeInterface.php b/src/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/SomeInterface.php index 09d7a8f35a..1fe5e09aa1 100644 --- a/src/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/SomeInterface.php +++ b/src/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/SomeInterface.php @@ -13,5 +13,4 @@ namespace ClassMap; interface SomeInterface { - } diff --git a/src/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/SomeParent.php b/src/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/SomeParent.php index 5a859a9460..ce2f9fc6c4 100644 --- a/src/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/SomeParent.php +++ b/src/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/SomeParent.php @@ -13,5 +13,4 @@ namespace ClassMap; abstract class SomeParent { - } diff --git a/src/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/multipleNs.php b/src/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/multipleNs.php index d19e07fc11..7db8cd3b67 100644 --- a/src/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/multipleNs.php +++ b/src/Symfony/Component/ClassLoader/Tests/Fixtures/classmap/multipleNs.php @@ -1,14 +1,24 @@ file.'.meta'; } - } diff --git a/src/Symfony/Component/Config/Definition/Builder/BooleanNodeDefinition.php b/src/Symfony/Component/Config/Definition/Builder/BooleanNodeDefinition.php index 3f8713bedb..979f9bac6d 100644 --- a/src/Symfony/Component/Config/Definition/Builder/BooleanNodeDefinition.php +++ b/src/Symfony/Component/Config/Definition/Builder/BooleanNodeDefinition.php @@ -39,5 +39,4 @@ class BooleanNodeDefinition extends ScalarNodeDefinition { return new BooleanNode($this->name, $this->parent); } - } diff --git a/src/Symfony/Component/Config/Definition/Builder/NodeBuilder.php b/src/Symfony/Component/Config/Definition/Builder/NodeBuilder.php index 5ea1c0e86e..e140df70de 100644 --- a/src/Symfony/Component/Config/Definition/Builder/NodeBuilder.php +++ b/src/Symfony/Component/Config/Definition/Builder/NodeBuilder.php @@ -243,5 +243,4 @@ class NodeBuilder implements NodeParentInterface return $class; } - } diff --git a/src/Symfony/Component/Config/Definition/Builder/NodeDefinition.php b/src/Symfony/Component/Config/Definition/Builder/NodeDefinition.php index a1a251f7b7..2efcd057ca 100644 --- a/src/Symfony/Component/Config/Definition/Builder/NodeDefinition.php +++ b/src/Symfony/Component/Config/Definition/Builder/NodeDefinition.php @@ -343,5 +343,4 @@ abstract class NodeDefinition implements NodeParentInterface * @throws InvalidDefinitionException When the definition is invalid */ abstract protected function createNode(); - } diff --git a/src/Symfony/Component/Config/Definition/Builder/VariableNodeDefinition.php b/src/Symfony/Component/Config/Definition/Builder/VariableNodeDefinition.php index aa148ffbcc..26196c8bc3 100644 --- a/src/Symfony/Component/Config/Definition/Builder/VariableNodeDefinition.php +++ b/src/Symfony/Component/Config/Definition/Builder/VariableNodeDefinition.php @@ -64,5 +64,4 @@ class VariableNodeDefinition extends NodeDefinition return $node; } - } diff --git a/src/Symfony/Component/Config/Definition/PrototypedArrayNode.php b/src/Symfony/Component/Config/Definition/PrototypedArrayNode.php index 80ad452696..a05faecfb7 100644 --- a/src/Symfony/Component/Config/Definition/PrototypedArrayNode.php +++ b/src/Symfony/Component/Config/Definition/PrototypedArrayNode.php @@ -323,7 +323,7 @@ class PrototypedArrayNode extends ArrayNode if (!array_key_exists($k, $leftSide)) { if (!$this->allowNewKeys) { $ex = new InvalidConfigurationException(sprintf( - 'You are not allowed to define new elements for path "%s". ' . + 'You are not allowed to define new elements for path "%s". '. 'Please define all elements for this path in one config file.', $this->getPath() )); diff --git a/src/Symfony/Component/Config/Definition/ReferenceDumper.php b/src/Symfony/Component/Config/Definition/ReferenceDumper.php index 26eea78e1a..f1a0a7bb8c 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/Loader/LoaderInterface.php b/src/Symfony/Component/Config/Loader/LoaderInterface.php index f01f7709d2..52d5981e8e 100644 --- a/src/Symfony/Component/Config/Loader/LoaderInterface.php +++ b/src/Symfony/Component/Config/Loader/LoaderInterface.php @@ -49,5 +49,4 @@ interface LoaderInterface * @param LoaderResolverInterface $resolver A LoaderResolverInterface instance */ public function setResolver(LoaderResolverInterface $resolver); - } diff --git a/src/Symfony/Component/Config/Tests/Definition/ArrayNodeTest.php b/src/Symfony/Component/Config/Tests/Definition/ArrayNodeTest.php index 4d19307580..d0d9e2e428 100644 --- a/src/Symfony/Component/Config/Tests/Definition/ArrayNodeTest.php +++ b/src/Symfony/Component/Config/Tests/Definition/ArrayNodeTest.php @@ -77,7 +77,7 @@ class ArrayNodeTest extends \PHPUnit_Framework_TestCase array( array('foo-bar' => null, 'foo_bar' => 'foo'), array('foo-bar' => null, 'foo_bar' => 'foo'), - ) + ), ); } diff --git a/src/Symfony/Component/Config/Tests/Definition/Builder/ArrayNodeDefinitionTest.php b/src/Symfony/Component/Config/Tests/Definition/Builder/ArrayNodeDefinitionTest.php index 06dacf2ab8..e75ed34f46 100644 --- a/src/Symfony/Component/Config/Tests/Definition/Builder/ArrayNodeDefinitionTest.php +++ b/src/Symfony/Component/Config/Tests/Definition/Builder/ArrayNodeDefinitionTest.php @@ -53,7 +53,7 @@ class ArrayNodeDefinitionTest extends \PHPUnit_Framework_TestCase array('defaultValue', array(array())), array('addDefaultChildrenIfNoneSet', array()), array('requiresAtLeastOneElement', array()), - array('useAttributeAsKey', array('foo')) + array('useAttributeAsKey', array('foo')), ); } diff --git a/src/Symfony/Component/Config/Tests/Definition/Builder/ExprBuilderTest.php b/src/Symfony/Component/Config/Tests/Definition/Builder/ExprBuilderTest.php index c18c696c45..13a28afcbd 100644 --- a/src/Symfony/Component/Config/Tests/Definition/Builder/ExprBuilderTest.php +++ b/src/Symfony/Component/Config/Tests/Definition/Builder/ExprBuilderTest.php @@ -15,7 +15,6 @@ use Symfony\Component\Config\Definition\Builder\TreeBuilder; class ExprBuilderTest extends \PHPUnit_Framework_TestCase { - public function testAlwaysExpression() { $test = $this->getTestBuilder() @@ -31,7 +30,7 @@ class ExprBuilderTest extends \PHPUnit_Framework_TestCase ->ifTrue() ->then($this->returnClosure('new_value')) ->end(); - $this->assertFinalizedValueIs('new_value', $test, array('key'=>true)); + $this->assertFinalizedValueIs('new_value', $test, array('key' => true)); $test = $this->getTestBuilder() ->ifTrue( function ($v) { return true; }) @@ -58,8 +57,7 @@ class ExprBuilderTest extends \PHPUnit_Framework_TestCase ->ifString() ->then($this->returnClosure('new_value')) ->end(); - $this->assertFinalizedValueIs(45, $test, array('key'=>45)); - + $this->assertFinalizedValueIs(45, $test, array('key' => 45)); } public function testIfNullExpression() @@ -68,7 +66,7 @@ class ExprBuilderTest extends \PHPUnit_Framework_TestCase ->ifNull() ->then($this->returnClosure('new_value')) ->end(); - $this->assertFinalizedValueIs('new_value', $test, array('key'=>null)); + $this->assertFinalizedValueIs('new_value', $test, array('key' => null)); $test = $this->getTestBuilder() ->ifNull() @@ -83,7 +81,7 @@ class ExprBuilderTest extends \PHPUnit_Framework_TestCase ->ifArray() ->then($this->returnClosure('new_value')) ->end(); - $this->assertFinalizedValueIs('new_value', $test, array('key'=>array())); + $this->assertFinalizedValueIs('new_value', $test, array('key' => array())); $test = $this->getTestBuilder() ->ifArray() @@ -182,7 +180,7 @@ class ExprBuilderTest extends \PHPUnit_Framework_TestCase ->end() ->end() ->buildTree() - ->finalize(null === $config ? array('key'=>'value') : $config) + ->finalize(null === $config ? array('key' => 'value') : $config) ; } @@ -207,6 +205,6 @@ class ExprBuilderTest extends \PHPUnit_Framework_TestCase */ protected function assertFinalizedValueIs($value, $treeBuilder, $config = null) { - $this->assertEquals(array('key'=>$value), $this->finalizeTestBuilder($treeBuilder, $config)); + $this->assertEquals(array('key' => $value), $this->finalizeTestBuilder($treeBuilder, $config)); } } diff --git a/src/Symfony/Component/Config/Tests/Definition/FloatNodeTest.php b/src/Symfony/Component/Config/Tests/Definition/FloatNodeTest.php index bdf79ecec9..4f308ca76b 100644 --- a/src/Symfony/Component/Config/Tests/Definition/FloatNodeTest.php +++ b/src/Symfony/Component/Config/Tests/Definition/FloatNodeTest.php @@ -34,7 +34,7 @@ class FloatNodeTest extends \PHPUnit_Framework_TestCase // Integer are accepted too, they will be cast array(17), array(-10), - array(0) + array(0), ); } diff --git a/src/Symfony/Component/Config/Tests/Definition/MergeTest.php b/src/Symfony/Component/Config/Tests/Definition/MergeTest.php index d78027d051..08ddc3209e 100644 --- a/src/Symfony/Component/Config/Tests/Definition/MergeTest.php +++ b/src/Symfony/Component/Config/Tests/Definition/MergeTest.php @@ -115,14 +115,14 @@ class MergeTest extends \PHPUnit_Framework_TestCase $a = array( 'test' => array( - 'a' => array('value' => 'foo') - ) + 'a' => array('value' => 'foo'), + ), ); $b = array( 'test' => array( - 'b' => array('value' => 'foo') - ) + 'b' => array('value' => 'foo'), + ), ); $tree->merge($a, $b); @@ -157,13 +157,13 @@ class MergeTest extends \PHPUnit_Framework_TestCase $b = array( 'no_deep_merging' => array( 'c' => 'd', - ) + ), ); $this->assertEquals(array( 'no_deep_merging' => array( 'c' => 'd', - ) + ), ), $tree->merge($a, $b)); } diff --git a/src/Symfony/Component/Config/Tests/Definition/NormalizationTest.php b/src/Symfony/Component/Config/Tests/Definition/NormalizationTest.php index 99f767bfda..a896f96221 100644 --- a/src/Symfony/Component/Config/Tests/Definition/NormalizationTest.php +++ b/src/Symfony/Component/Config/Tests/Definition/NormalizationTest.php @@ -176,8 +176,8 @@ class NormalizationTest extends \PHPUnit_Framework_TestCase { $denormalized = array( 'thing' => array( - array('foo', 'bar'), array('baz', 'qux') - ) + array('foo', 'bar'), array('baz', 'qux'), + ), ); $this->assertNormalized($this->getNumericKeysTestTree(), $denormalized, array()); diff --git a/src/Symfony/Component/Config/Tests/Definition/ReferenceDumperTest.php b/src/Symfony/Component/Config/Tests/Definition/ReferenceDumperTest.php index 137caf8cbc..5b4aea9b39 100644 --- a/src/Symfony/Component/Config/Tests/Definition/ReferenceDumperTest.php +++ b/src/Symfony/Component/Config/Tests/Definition/ReferenceDumperTest.php @@ -26,7 +26,7 @@ class ReferenceDumperTest extends \PHPUnit_Framework_TestCase private function getConfigurationAsString() { - return <<isDir()) { - rmdir($path->__toString()); + rmdir($path->__toString()); } else { - unlink($path->__toString()); + unlink($path->__toString()); } } rmdir($directory); diff --git a/src/Symfony/Component/Console/Application.php b/src/Symfony/Component/Console/Application.php index 029dc29e00..4b682e706a 100644 --- a/src/Symfony/Component/Console/Application.php +++ b/src/Symfony/Component/Console/Application.php @@ -532,7 +532,7 @@ class Application throw new \InvalidArgumentException(sprintf('The namespace "%s" is ambiguous (%s).', $namespace, $this->getAbbreviationSuggestions($abbrevs[$part]))); } - $found .= $found ? ':' . $abbrevs[$part][0] : $abbrevs[$part][0]; + $found .= $found ? ':'.$abbrevs[$part][0] : $abbrevs[$part][0]; } return $found; diff --git a/src/Symfony/Component/Console/Formatter/OutputFormatterStyle.php b/src/Symfony/Component/Console/Formatter/OutputFormatterStyle.php index f0bbd38372..0a3e69ef27 100644 --- a/src/Symfony/Component/Console/Formatter/OutputFormatterStyle.php +++ b/src/Symfony/Component/Console/Formatter/OutputFormatterStyle.php @@ -28,7 +28,7 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface 'blue' => 34, 'magenta' => 35, 'cyan' => 36, - 'white' => 37 + 'white' => 37, ); private static $availableBackgroundColors = array( 'black' => 40, @@ -38,14 +38,14 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface 'blue' => 44, 'magenta' => 45, 'cyan' => 46, - 'white' => 47 + 'white' => 47, ); private static $availableOptions = array( 'bold' => 1, 'underscore' => 4, 'blink' => 5, 'reverse' => 7, - 'conceal' => 8 + 'conceal' => 8, ); private $foreground; diff --git a/src/Symfony/Component/Console/Helper/DialogHelper.php b/src/Symfony/Component/Console/Helper/DialogHelper.php index 6605e8939d..89c1587f43 100644 --- a/src/Symfony/Component/Console/Helper/DialogHelper.php +++ b/src/Symfony/Component/Console/Helper/DialogHelper.php @@ -146,7 +146,8 @@ class DialogHelper extends Helper // Pop the last character off the end of our string $ret = substr($ret, 0, $i); - } elseif ("\033" === $c) { // Did we read an escape sequence? + } elseif ("\033" === $c) { + // Did we read an escape sequence? $c .= fread($inputStream, 2); // A = Up Arrow. B = Down Arrow diff --git a/src/Symfony/Component/Console/Input/ArgvInput.php b/src/Symfony/Component/Console/Input/ArgvInput.php index 3a0f0a7193..1e02a1cba8 100644 --- a/src/Symfony/Component/Console/Input/ArgvInput.php +++ b/src/Symfony/Component/Console/Input/ArgvInput.php @@ -169,7 +169,7 @@ class ArgvInput extends Input // if input is expecting another argument, add it if ($this->definition->hasArgument($c)) { $arg = $this->definition->getArgument($c); - $this->arguments[$arg->getName()] = $arg->isArray()? array($token) : $token; + $this->arguments[$arg->getName()] = $arg->isArray() ? array($token) : $token; // if last argument isArray(), append token to last argument } elseif ($this->definition->hasArgument($c - 1) && $this->definition->getArgument($c - 1)->isArray()) { @@ -336,7 +336,7 @@ class ArgvInput extends Input $self = $this; $tokens = array_map(function ($token) use ($self) { if (preg_match('{^(-[^=]+=)(.+)}', $token, $match)) { - return $match[1] . $self->escapeToken($match[2]); + return $match[1].$self->escapeToken($match[2]); } if ($token && $token[0] !== '-') { diff --git a/src/Symfony/Component/Console/Input/ArrayInput.php b/src/Symfony/Component/Console/Input/ArrayInput.php index 27d91323f3..e723f75be0 100644 --- a/src/Symfony/Component/Console/Input/ArrayInput.php +++ b/src/Symfony/Component/Console/Input/ArrayInput.php @@ -120,7 +120,7 @@ class ArrayInput extends Input $params = array(); foreach ($this->parameters as $param => $val) { if ($param && '-' === $param[0]) { - $params[] = $param . ('' != $val ? '='.$this->escapeToken($val) : ''); + $params[] = $param.('' != $val ? '='.$this->escapeToken($val) : ''); } else { $params[] = $this->escapeToken($val); } diff --git a/src/Symfony/Component/Console/Tests/ApplicationTest.php b/src/Symfony/Component/Console/Tests/ApplicationTest.php index 2c27339a6e..07411444f4 100644 --- a/src/Symfony/Component/Console/Tests/ApplicationTest.php +++ b/src/Symfony/Component/Console/Tests/ApplicationTest.php @@ -240,7 +240,7 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase return array( array('f', 'Command "f" is not defined.'), array('a', 'Command "a" is ambiguous (afoobar, afoobar1 and 1 more).'), - array('foo:b', 'Command "foo:b" is ambiguous (foo:bar, foo:bar1).') + array('foo:b', 'Command "foo:b" is ambiguous (foo:bar, foo:bar1).'), ); } @@ -270,7 +270,7 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase { return array( array('foo:baR'), - array('foO:bar') + array('foO:bar'), ); } diff --git a/src/Symfony/Component/Console/Tests/Command/CommandTest.php b/src/Symfony/Component/Console/Tests/Command/CommandTest.php index 872bb7fc42..6505f0da80 100644 --- a/src/Symfony/Component/Console/Tests/Command/CommandTest.php +++ b/src/Symfony/Component/Console/Tests/Command/CommandTest.php @@ -111,7 +111,7 @@ class CommandTest extends \PHPUnit_Framework_TestCase { return array( array(''), - array('foo:') + array('foo:'), ); } diff --git a/src/Symfony/Component/Console/Tests/Command/ListCommandTest.php b/src/Symfony/Component/Console/Tests/Command/ListCommandTest.php index ca50874912..fbb9feeb68 100644 --- a/src/Symfony/Component/Console/Tests/Command/ListCommandTest.php +++ b/src/Symfony/Component/Console/Tests/Command/ListCommandTest.php @@ -49,7 +49,6 @@ EOF; public function testExecuteListsCommandsWithNamespaceArgument() { - require_once realpath(__DIR__.'/../Fixtures/FooCommand.php'); $application = new Application(); $application->add(new \FooCommand()); diff --git a/src/Symfony/Component/Console/Tests/Helper/DialogHelperTest.php b/src/Symfony/Component/Console/Tests/Helper/DialogHelperTest.php index 118cc44dbb..7bd24ed039 100644 --- a/src/Symfony/Component/Console/Tests/Helper/DialogHelperTest.php +++ b/src/Symfony/Component/Console/Tests/Helper/DialogHelperTest.php @@ -133,7 +133,7 @@ class DialogHelperTest extends \PHPUnit_Framework_TestCase $helperSet = new HelperSet(array(new FormatterHelper())); $dialog->setHelperSet($helperSet); - $question ='What color was the white horse of Henry IV?'; + $question = 'What color was the white horse of Henry IV?'; $error = 'This is not a color!'; $validator = function ($color) use ($error) { if (!in_array($color, array('white', 'black'))) { diff --git a/src/Symfony/Component/Console/Tests/Helper/FormatterHelperTest.php b/src/Symfony/Component/Console/Tests/Helper/FormatterHelperTest.php index db61de4f61..e332774757 100644 --- a/src/Symfony/Component/Console/Tests/Helper/FormatterHelperTest.php +++ b/src/Symfony/Component/Console/Tests/Helper/FormatterHelperTest.php @@ -37,15 +37,15 @@ class FormatterHelperTest extends \PHPUnit_Framework_TestCase ); $this->assertEquals( - ' Some text to display '."\n" . + ' Some text to display '."\n". ' foo bar ', $formatter->formatBlock(array('Some text to display', 'foo bar'), 'error'), '::formatBlock() formats a message in a block' ); $this->assertEquals( - ' '."\n" . - ' Some text to display '."\n" . + ' '."\n". + ' Some text to display '."\n". ' ', $formatter->formatBlock('Some text to display', 'error', true), '::formatBlock() formats a message in a block' @@ -61,8 +61,8 @@ class FormatterHelperTest extends \PHPUnit_Framework_TestCase $formatter = new FormatterHelper(); $this->assertEquals( - ' '."\n" . - ' Du texte à afficher '."\n" . + ' '."\n". + ' Du texte à afficher '."\n". ' ', $formatter->formatBlock('Du texte à afficher', 'error', true), '::formatBlock() formats a message in a block' @@ -76,8 +76,8 @@ class FormatterHelperTest extends \PHPUnit_Framework_TestCase } $formatter = new FormatterHelper(); $this->assertEquals( - ' '."\n" . - ' 表示するテキスト '."\n" . + ' '."\n". + ' 表示するテキスト '."\n". ' ', $formatter->formatBlock('表示するテキスト', 'error', true), '::formatBlock() formats a message in a block' @@ -89,8 +89,8 @@ class FormatterHelperTest extends \PHPUnit_Framework_TestCase $formatter = new FormatterHelper(); $this->assertEquals( - ' '."\n" . - ' \some info\ '."\n" . + ' '."\n". + ' \some info\ '."\n". ' ', $formatter->formatBlock('some info', 'error', true), '::formatBlock() escapes \'<\' chars' diff --git a/src/Symfony/Component/Console/Tests/Helper/ProgressHelperTest.php b/src/Symfony/Component/Console/Tests/Helper/ProgressHelperTest.php index 266cc3d1c3..2d2ec82b12 100644 --- a/src/Symfony/Component/Console/Tests/Helper/ProgressHelperTest.php +++ b/src/Symfony/Component/Console/Tests/Helper/ProgressHelperTest.php @@ -88,8 +88,8 @@ class ProgressHelperTest extends \PHPUnit_Framework_TestCase rewind($output->getStream()); $this->assertEquals( - $this->generateOutput(' 0/50 [>---------------------------] 0%') . - $this->generateOutput(' 1/50 [>---------------------------] 2%') . + $this->generateOutput(' 0/50 [>---------------------------] 0%'). + $this->generateOutput(' 1/50 [>---------------------------] 2%'). $this->generateOutput(' 2/50 [=>--------------------------] '), stream_get_contents($output->getStream()) ); @@ -106,9 +106,9 @@ class ProgressHelperTest extends \PHPUnit_Framework_TestCase rewind($output->getStream()); $this->assertEquals( - $this->generateOutput(' 0/50 [>---------------------------] 0%') . - $this->generateOutput(' 1/50 [>---------------------------] 2%') . - $this->generateOutput(' 15/50 [========>-------------------] 30%') . + $this->generateOutput(' 0/50 [>---------------------------] 0%'). + $this->generateOutput(' 1/50 [>---------------------------] 2%'). + $this->generateOutput(' 15/50 [========>-------------------] 30%'). $this->generateOutput(' 25/50 [==============>-------------] 50%'), stream_get_contents($output->getStream()) ); diff --git a/src/Symfony/Component/Console/Tests/Input/ArgvInputTest.php b/src/Symfony/Component/Console/Tests/Input/ArgvInputTest.php index 507990d2cf..451b108179 100644 --- a/src/Symfony/Component/Console/Tests/Input/ArgvInputTest.php +++ b/src/Symfony/Component/Console/Tests/Input/ArgvInputTest.php @@ -57,92 +57,92 @@ class ArgvInputTest extends \PHPUnit_Framework_TestCase array('cli.php', '--foo'), array(new InputOption('foo')), array('foo' => true), - '->parse() parses long options without a value' + '->parse() parses long options without a value', ), array( array('cli.php', '--foo=bar'), array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)), array('foo' => 'bar'), - '->parse() parses long options with a required value (with a = separator)' + '->parse() parses long options with a required value (with a = separator)', ), array( array('cli.php', '--foo', 'bar'), array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)), array('foo' => 'bar'), - '->parse() parses long options with a required value (with a space separator)' + '->parse() parses long options with a required value (with a space separator)', ), array( array('cli.php', '-f'), array(new InputOption('foo', 'f')), array('foo' => true), - '->parse() parses short options without a value' + '->parse() parses short options without a value', ), array( array('cli.php', '-fbar'), array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)), array('foo' => 'bar'), - '->parse() parses short options with a required value (with no separator)' + '->parse() parses short options with a required value (with no separator)', ), array( array('cli.php', '-f', 'bar'), array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED)), array('foo' => 'bar'), - '->parse() parses short options with a required value (with a space separator)' + '->parse() parses short options with a required value (with a space separator)', ), array( array('cli.php', '-f', ''), array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL)), array('foo' => ''), - '->parse() parses short options with an optional empty value' + '->parse() parses short options with an optional empty value', ), array( array('cli.php', '-f', '', 'foo'), array(new InputArgument('name'), new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL)), array('foo' => ''), - '->parse() parses short options with an optional empty value followed by an argument' + '->parse() parses short options with an optional empty value followed by an argument', ), array( array('cli.php', '-f', '', '-b'), array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputOption('bar', 'b')), array('foo' => '', 'bar' => true), - '->parse() parses short options with an optional empty value followed by an option' + '->parse() parses short options with an optional empty value followed by an option', ), array( array('cli.php', '-f', '-b', 'foo'), array(new InputArgument('name'), new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputOption('bar', 'b')), array('foo' => null, 'bar' => true), - '->parse() parses short options with an optional value which is not present' + '->parse() parses short options with an optional value which is not present', ), array( array('cli.php', '-fb'), array(new InputOption('foo', 'f'), new InputOption('bar', 'b')), array('foo' => true, 'bar' => true), - '->parse() parses short options when they are aggregated as a single one' + '->parse() parses short options when they are aggregated as a single one', ), array( array('cli.php', '-fb', 'bar'), array(new InputOption('foo', 'f'), new InputOption('bar', 'b', InputOption::VALUE_REQUIRED)), array('foo' => true, 'bar' => 'bar'), - '->parse() parses short options when they are aggregated as a single one and the last one has a required value' + '->parse() parses short options when they are aggregated as a single one and the last one has a required value', ), array( array('cli.php', '-fb', 'bar'), array(new InputOption('foo', 'f'), new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL)), array('foo' => true, 'bar' => 'bar'), - '->parse() parses short options when they are aggregated as a single one and the last one has an optional value' + '->parse() parses short options when they are aggregated as a single one and the last one has an optional value', ), array( array('cli.php', '-fbbar'), array(new InputOption('foo', 'f'), new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL)), array('foo' => true, 'bar' => 'bar'), - '->parse() parses short options when they are aggregated as a single one and the last one has an optional value with no separator' + '->parse() parses short options when they are aggregated as a single one and the last one has an optional value with no separator', ), array( array('cli.php', '-fbbar'), array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL), new InputOption('bar', 'b', InputOption::VALUE_OPTIONAL)), array('foo' => 'bbar', 'bar' => null), - '->parse() parses short options when they are aggregated as a single one and one of them takes a value' - ) + '->parse() parses short options when they are aggregated as a single one and one of them takes a value', + ), ); } @@ -163,43 +163,43 @@ class ArgvInputTest extends \PHPUnit_Framework_TestCase array( array('cli.php', '--foo'), new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED))), - 'The "--foo" option requires a value.' + 'The "--foo" option requires a value.', ), array( array('cli.php', '-f'), new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED))), - 'The "--foo" option requires a value.' + 'The "--foo" option requires a value.', ), array( array('cli.php', '-ffoo'), new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_NONE))), - 'The "-o" option does not exist.' + 'The "-o" option does not exist.', ), array( array('cli.php', '--foo=bar'), new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_NONE))), - 'The "--foo" option does not accept a value.' + 'The "--foo" option does not accept a value.', ), array( array('cli.php', 'foo', 'bar'), new InputDefinition(), - 'Too many arguments.' + 'Too many arguments.', ), array( array('cli.php', '--foo'), new InputDefinition(), - 'The "--foo" option does not exist.' + 'The "--foo" option does not exist.', ), array( array('cli.php', '-f'), new InputDefinition(), - 'The "-f" option does not exist.' + 'The "-f" option does not exist.', ), array( array('cli.php', '-1'), new InputDefinition(array(new InputArgument('number'))), - 'The "-1" option does not exist.' - ) + 'The "-1" option does not exist.', + ), ); } diff --git a/src/Symfony/Component/Console/Tests/Input/ArrayInputTest.php b/src/Symfony/Component/Console/Tests/Input/ArrayInputTest.php index 73f2e33e4e..7cf28e8f49 100644 --- a/src/Symfony/Component/Console/Tests/Input/ArrayInputTest.php +++ b/src/Symfony/Component/Console/Tests/Input/ArrayInputTest.php @@ -62,26 +62,26 @@ class ArrayInputTest extends \PHPUnit_Framework_TestCase array('--foo' => 'bar'), array(new InputOption('foo')), array('foo' => 'bar'), - '->parse() parses long options' + '->parse() parses long options', ), array( array('--foo' => 'bar'), array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, '', 'default')), array('foo' => 'bar'), - '->parse() parses long options with a default value' + '->parse() parses long options with a default value', ), array( array('--foo' => null), array(new InputOption('foo', 'f', InputOption::VALUE_OPTIONAL, '', 'default')), array('foo' => 'default'), - '->parse() parses long options with a default value' + '->parse() parses long options with a default value', ), array( array('-f' => 'bar'), array(new InputOption('foo', 'f')), array('foo' => 'bar'), - '->parse() parses short options' - ) + '->parse() parses short options', + ), ); } @@ -101,23 +101,23 @@ class ArrayInputTest extends \PHPUnit_Framework_TestCase array( array('foo' => 'foo'), new InputDefinition(array(new InputArgument('name'))), - 'The "foo" argument does not exist.' + 'The "foo" argument does not exist.', ), array( array('--foo' => null), new InputDefinition(array(new InputOption('foo', 'f', InputOption::VALUE_REQUIRED))), - 'The "--foo" option requires a value.' + 'The "--foo" option requires a value.', ), array( array('--foo' => 'foo'), new InputDefinition(), - 'The "--foo" option does not exist.' + 'The "--foo" option does not exist.', ), array( array('-o' => 'foo'), new InputDefinition(), - 'The "-o" option does not exist.' - ) + 'The "-o" option does not exist.', + ), ); } diff --git a/src/Symfony/Component/Console/Tests/Input/InputArgumentTest.php b/src/Symfony/Component/Console/Tests/Input/InputArgumentTest.php index 3bfc796696..cfb37cd410 100644 --- a/src/Symfony/Component/Console/Tests/Input/InputArgumentTest.php +++ b/src/Symfony/Component/Console/Tests/Input/InputArgumentTest.php @@ -50,7 +50,7 @@ class InputArgumentTest extends \PHPUnit_Framework_TestCase { return array( array('ANOTHER_ONE'), - array(-1) + array(-1), ); } diff --git a/src/Symfony/Component/Console/Tests/Input/InputOptionTest.php b/src/Symfony/Component/Console/Tests/Input/InputOptionTest.php index 5817e8fb8e..53ce1df8cf 100644 --- a/src/Symfony/Component/Console/Tests/Input/InputOptionTest.php +++ b/src/Symfony/Component/Console/Tests/Input/InputOptionTest.php @@ -86,7 +86,7 @@ class InputOptionTest extends \PHPUnit_Framework_TestCase { return array( array('ANOTHER_ONE'), - array(-1) + array(-1), ); } diff --git a/src/Symfony/Component/CssSelector/Parser/Parser.php b/src/Symfony/Component/CssSelector/Parser/Parser.php index 6c7c3be583..c622383e84 100644 --- a/src/Symfony/Component/CssSelector/Parser/Parser.php +++ b/src/Symfony/Component/CssSelector/Parser/Parser.php @@ -96,7 +96,7 @@ class Parser implements ParserInterface return array( $first ? ('-' === $first || '+' === $first ? $int($first.'1') : $int($first)) : 1, - isset($split[1]) && $split[1] ? $int($split[1]) : 0 + isset($split[1]) && $split[1] ? $int($split[1]) : 0, ); } diff --git a/src/Symfony/Component/CssSelector/Parser/Shortcut/ClassParser.php b/src/Symfony/Component/CssSelector/Parser/Shortcut/ClassParser.php index db352334f0..bb9653ce01 100644 --- a/src/Symfony/Component/CssSelector/Parser/Shortcut/ClassParser.php +++ b/src/Symfony/Component/CssSelector/Parser/Shortcut/ClassParser.php @@ -41,7 +41,7 @@ class ClassParser implements ParserInterface // 4 => string 'ab6bd_field' (length=11) if (preg_match('/^(([a-z]+)\|)?([\w-]+|\*)?\.([\w-]+)$/i', trim($source), $matches)) { return array( - new SelectorNode(new ClassNode(new ElementNode($matches[2] ?: null, $matches[3] ?: null), $matches[4])) + new SelectorNode(new ClassNode(new ElementNode($matches[2] ?: null, $matches[3] ?: null), $matches[4])), ); } diff --git a/src/Symfony/Component/CssSelector/Parser/Shortcut/HashParser.php b/src/Symfony/Component/CssSelector/Parser/Shortcut/HashParser.php index 95d7d5f911..28c7d296f1 100644 --- a/src/Symfony/Component/CssSelector/Parser/Shortcut/HashParser.php +++ b/src/Symfony/Component/CssSelector/Parser/Shortcut/HashParser.php @@ -41,7 +41,7 @@ class HashParser implements ParserInterface // 4 => string 'ab6bd_field' (length=11) if (preg_match('/^(([a-z]+)\|)?([\w-]+|\*)?#([\w-]+)$/i', trim($source), $matches)) { return array( - new SelectorNode(new HashNode(new ElementNode($matches[2] ?: null, $matches[3] ?: null), $matches[4])) + new SelectorNode(new HashNode(new ElementNode($matches[2] ?: null, $matches[3] ?: null), $matches[4])), ); } diff --git a/src/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerEscaping.php b/src/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerEscaping.php index 921fc393a9..76386c9371 100644 --- a/src/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerEscaping.php +++ b/src/Symfony/Component/CssSelector/Parser/Tokenizer/TokenizerEscaping.php @@ -72,10 +72,10 @@ class TokenizerEscaping return chr($c); } if (0x800 > $c) { - return chr(0xC0 | $c>>6).chr(0x80 | $c & 0x3F); + return chr(0xC0 | $c >> 6).chr(0x80 | $c & 0x3F); } if (0x10000 > $c) { - return chr(0xE0 | $c>>12).chr(0x80 | $c>>6 & 0x3F).chr(0x80 | $c & 0x3F); + return chr(0xE0 | $c >> 12).chr(0x80 | $c >> 6 & 0x3F).chr(0x80 | $c & 0x3F); } }, $value); } diff --git a/src/Symfony/Component/Debug/Tests/Exception/FlattenExceptionTest.php b/src/Symfony/Component/Debug/Tests/Exception/FlattenExceptionTest.php index 4caa9ed345..0c0f42d80b 100644 --- a/src/Symfony/Component/Debug/Tests/Exception/FlattenExceptionTest.php +++ b/src/Symfony/Component/Debug/Tests/Exception/FlattenExceptionTest.php @@ -114,7 +114,6 @@ class FlattenExceptionTest extends \PHPUnit_Framework_TestCase $this->assertEquals($exception->getMessage(), $flattened->getMessage(), 'The message is copied from the original exception.'); $this->assertEquals($exception->getCode(), $flattened->getCode(), 'The code is copied from the original exception.'); $this->assertInstanceOf($flattened->getClass(), $exception, 'The class is set to the class of the original exception'); - } /** @@ -160,13 +159,13 @@ class FlattenExceptionTest extends \PHPUnit_Framework_TestCase $this->assertEquals(array( array( - 'message'=> 'test', - 'class'=>'Exception', - 'trace'=>array(array( + 'message' => 'test', + 'class' => 'Exception', + 'trace' => array(array( 'namespace' => '', 'short_class' => '', 'class' => '','type' => '','function' => '', 'file' => 'foo.php', 'line' => 123, - 'args' => array() + 'args' => array(), )), - ) + ), ), $flattened->toArray()); } @@ -202,7 +201,7 @@ class FlattenExceptionTest extends \PHPUnit_Framework_TestCase 'line' => 123, 'function' => 'test', 'args' => array( - unserialize('O:14:"BogusTestClass":0:{}') + unserialize('O:14:"BogusTestClass":0:{}'), ), ), ), @@ -211,9 +210,9 @@ class FlattenExceptionTest extends \PHPUnit_Framework_TestCase $this->assertEquals(array( array( - 'message'=> 'test', - 'class'=>'Exception', - 'trace'=>array( + 'message' => 'test', + 'class' => 'Exception', + 'trace' => array( array( 'namespace' => '', 'short_class' => '', 'class' => '','type' => '','function' => '', 'file' => 'foo.php', 'line' => 123, @@ -224,12 +223,12 @@ class FlattenExceptionTest extends \PHPUnit_Framework_TestCase 'file' => __FILE__, 'line' => 123, 'args' => array( array( - 'incomplete-object', 'BogusTestClass' + 'incomplete-object', 'BogusTestClass', ), ), - ) + ), ), - ) + ), ), $flattened->toArray()); } } diff --git a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php index 7e18a52022..b8addc10f5 100644 --- a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php +++ b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php @@ -196,7 +196,7 @@ class PhpDumper extends Dumper $code = ''; foreach ($definitions as $definition) { - $code .= "\n" . $this->getProxyDumper()->getProxyCode($definition); + $code .= "\n".$this->getProxyDumper()->getProxyCode($definition); } return $code; @@ -844,7 +844,7 @@ EOF; $code .= ' '.var_export($id, true).' => '.var_export('get'.$this->camelize($id).'Service', true).",\n"; } - return $code . " );\n"; + return $code." );\n"; } /** @@ -872,7 +872,7 @@ EOF; $code .= ' '.var_export($alias, true).' => '.var_export($id, true).",\n"; } - return $code . " );\n"; + return $code." );\n"; } /** diff --git a/src/Symfony/Component/DependencyInjection/IntrospectableContainerInterface.php b/src/Symfony/Component/DependencyInjection/IntrospectableContainerInterface.php index c2fe7745d2..f0853fe01e 100644 --- a/src/Symfony/Component/DependencyInjection/IntrospectableContainerInterface.php +++ b/src/Symfony/Component/DependencyInjection/IntrospectableContainerInterface.php @@ -29,5 +29,4 @@ interface IntrospectableContainerInterface extends ContainerInterface * */ public function initialized($id); - } diff --git a/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php b/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php index 5890ed84c1..c42db5adeb 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php @@ -477,7 +477,7 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase 'foo' => array( array('foo' => 'foo'), array('foofoo' => 'foofoo'), - ) + ), ), '->findTaggedServiceIds() returns an array of service ids and its tag attributes'); $this->assertEquals(array(), $builder->findTaggedServiceIds('foobar'), '->findTaggedServiceIds() returns an empty array if there is annotated services'); } @@ -659,7 +659,7 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase $container->addDefinitions(array( 'bar' => $fooDefinition, - 'bar_user' => $fooUserDefinition + 'bar_user' => $fooUserDefinition, )); $container->compile(); @@ -820,7 +820,9 @@ class ContainerBuilderTest extends \PHPUnit_Framework_TestCase } } -class FooClass {} +class FooClass +{ +} class ProjectContainer extends ContainerBuilder { diff --git a/src/Symfony/Component/DependencyInjection/Tests/ContainerTest.php b/src/Symfony/Component/DependencyInjection/Tests/ContainerTest.php index e145c7a10c..314f3e61f1 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/ContainerTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/ContainerTest.php @@ -228,7 +228,6 @@ class ContainerTest extends \PHPUnit_Framework_TestCase public function testGetCircularReference() { - $sc = new ProjectServiceContainer(); try { $sc->get('circular'); diff --git a/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php b/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php index 1a64508413..1900af1851 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php @@ -62,7 +62,7 @@ class PhpDumperTest extends \PHPUnit_Framework_TestCase 'concatenation from the start value' => '\'\'.', '.' => 'dot as a key', '.\'\'.' => 'concatenation as a key', - '\'\'.' =>'concatenation from the start key', + '\'\'.' => 'concatenation from the start key', 'optimize concatenation' => "string1%some_string%string2", 'optimize concatenation with empty string' => "string1%empty_value%string2", 'optimize concatenation from the start' => '%empty_value%start', diff --git a/src/Symfony/Component/DependencyInjection/Tests/Extension/ExtensionTest.php b/src/Symfony/Component/DependencyInjection/Tests/Extension/ExtensionTest.php index e35bbd5d3c..e7f19a6e94 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Extension/ExtensionTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Extension/ExtensionTest.php @@ -54,7 +54,7 @@ class ExtensionTest extends \PHPUnit_Framework_TestCase { return array( array(true), - array(false) + array(false), ); } diff --git a/src/Symfony/Component/DomCrawler/FormFieldRegistry.php b/src/Symfony/Component/DomCrawler/FormFieldRegistry.php index 150f94dfc6..39d4774a08 100644 --- a/src/Symfony/Component/DomCrawler/FormFieldRegistry.php +++ b/src/Symfony/Component/DomCrawler/FormFieldRegistry.php @@ -33,16 +33,16 @@ class FormFieldRegistry { $segments = $this->getSegments($field->getName()); - $target =& $this->fields; + $target = & $this->fields; while ($segments) { if (!is_array($target)) { $target = array(); } $path = array_shift($segments); if ('' === $path) { - $target =& $target[]; + $target = & $target[]; } else { - $target =& $target[$path]; + $target = & $target[$path]; } } $target = $field; @@ -58,13 +58,13 @@ class FormFieldRegistry public function remove($name) { $segments = $this->getSegments($name); - $target =& $this->fields; + $target = & $this->fields; while (count($segments) > 1) { $path = array_shift($segments); if (!array_key_exists($path, $target)) { return; } - $target =& $target[$path]; + $target = & $target[$path]; } unset($target[array_shift($segments)]); } @@ -82,13 +82,13 @@ class FormFieldRegistry public function &get($name) { $segments = $this->getSegments($name); - $target =& $this->fields; + $target = & $this->fields; while ($segments) { $path = array_shift($segments); if (!array_key_exists($path, $target)) { throw new \InvalidArgumentException(sprintf('Unreachable field "%s"', $path)); } - $target =& $target[$path]; + $target = & $target[$path]; } return $target; @@ -123,7 +123,7 @@ class FormFieldRegistry */ public function set($name, $value) { - $target =& $this->get($name); + $target = & $this->get($name); if (!is_array($value) || $target instanceof Field\ChoiceFormField) { $target->setValue($value); } else { diff --git a/src/Symfony/Component/DomCrawler/Tests/Field/FileFormFieldTest.php b/src/Symfony/Component/DomCrawler/Tests/Field/FileFormFieldTest.php index 066cdb0ef3..3ce49a46ef 100644 --- a/src/Symfony/Component/DomCrawler/Tests/Field/FileFormFieldTest.php +++ b/src/Symfony/Component/DomCrawler/Tests/Field/FileFormFieldTest.php @@ -111,5 +111,4 @@ class FileFormFieldTest extends FormFieldTestCase $this->assertEquals(__FILE__, $field->getValue()); } - } diff --git a/src/Symfony/Component/DomCrawler/Tests/FormTest.php b/src/Symfony/Component/DomCrawler/Tests/FormTest.php index 0195813858..4a556c6eea 100644 --- a/src/Symfony/Component/DomCrawler/Tests/FormTest.php +++ b/src/Symfony/Component/DomCrawler/Tests/FormTest.php @@ -132,13 +132,13 @@ class FormTest extends \PHPUnit_Framework_TestCase 'apples' => array('1', '2'), 'form_name' => 'form-1', 'button_1' => 'Capture fields', - 'outer_field' => 'success' + 'outer_field' => 'success', ); $values2 = array( 'oranges' => array('1', '2', '3'), 'form_name' => 'form_2', 'button_2' => '', - 'app_frontend_form_type_contact_form_type' => array('contactType' => '', 'firstName' => 'John') + 'app_frontend_form_type_contact_form_type' => array('contactType' => '', 'firstName' => 'John'), ); $this->assertEquals($values1, $form1->getPhpValues(), 'HTML5-compliant form attribute handled incorrectly'); @@ -178,7 +178,6 @@ class FormTest extends \PHPUnit_Framework_TestCase $this->assertEquals($form->get('bar[foo][0]')->getValue(), 'bar'); $this->assertEquals($form->get('bar[foo][foobar]')->getValue(), 'foobar'); - } /** @@ -414,7 +413,6 @@ class FormTest extends \PHPUnit_Framework_TestCase $form = $this->createForm('
'); $this->assertEquals(array('foo' => array('bar' => 'foo'), 'bar' => 'bar'), $form->getPhpValues(), "->getPhpValues() doesn't return empty values"); - } public function testGetFiles() @@ -480,7 +478,7 @@ class FormTest extends \PHPUnit_Framework_TestCase public function testGetUriActionAbsolute() { - $formHtml='
'; + $formHtml = '
'; $form = $this->createForm($formHtml); $this->assertEquals('https://login.foo.com/login.php?login_attempt=1', $form->getUri(), '->getUri() returns absolute URIs set in the action form'); @@ -527,52 +525,52 @@ class FormTest extends \PHPUnit_Framework_TestCase 'returns the URI of the form', '
', array(), - '/foo' + '/foo', ), array( 'appends the form values if the method is get', '
', array(), - '/foo?foo=foo' + '/foo?foo=foo', ), array( 'appends the form values and merges the submitted values', '
', array('foo' => 'bar'), - '/foo?foo=bar' + '/foo?foo=bar', ), array( 'does not append values if the method is post', '
', array(), - '/foo' + '/foo', ), array( 'does not append values if the method is patch', '
', array(), '/foo', - 'PUT' + 'PUT', ), array( 'does not append values if the method is delete', '
', array(), '/foo', - 'DELETE' + 'DELETE', ), array( 'does not append values if the method is put', '
', array(), '/foo', - 'PATCH' + 'PATCH', ), array( 'appends the form values to an existing query string', '
', array(), - '/foo?bar=bar&foo=foo' + '/foo?bar=bar&foo=foo', ), array( 'returns an empty URI if the action is empty', @@ -777,8 +775,8 @@ class FormTest extends \PHPUnit_Framework_TestCase 2 => 2, 3 => 3, 'bar' => array( - 'baz' => 'fbb' - ) + 'baz' => 'fbb', + ), )); } @@ -908,8 +906,8 @@ class FormTest extends \PHPUnit_Framework_TestCase public function testgetPhpValuesWithEmptyTextarea() { - $dom = new \DOMDocument(); - $dom->loadHTML(' + $dom = new \DOMDocument(); + $dom->loadHTML('
@@ -917,8 +915,8 @@ class FormTest extends \PHPUnit_Framework_TestCase '); - $nodes = $dom->getElementsByTagName('form'); - $form = new Form($nodes->item(0), 'http://example.com'); - $this->assertEquals($form->getPhpValues(), array('example' => '')); + $nodes = $dom->getElementsByTagName('form'); + $form = new Form($nodes->item(0), 'http://example.com'); + $this->assertEquals($form->getPhpValues(), array('example' => '')); } } diff --git a/src/Symfony/Component/EventDispatcher/Tests/EventDispatcherTest.php b/src/Symfony/Component/EventDispatcher/Tests/EventDispatcherTest.php index 1053c290ee..375e0f1c3b 100644 --- a/src/Symfony/Component/EventDispatcher/Tests/EventDispatcherTest.php +++ b/src/Symfony/Component/EventDispatcher/Tests/EventDispatcherTest.php @@ -340,7 +340,7 @@ class TestEventSubscriberWithMultipleListeners implements EventSubscriberInterfa { return array('pre.foo' => array( array('preFoo1'), - array('preFoo2', 10) + array('preFoo2', 10), )); } } diff --git a/src/Symfony/Component/EventDispatcher/Tests/GenericEventTest.php b/src/Symfony/Component/EventDispatcher/Tests/GenericEventTest.php index 5dfda92f2a..1090bcb296 100644 --- a/src/Symfony/Component/EventDispatcher/Tests/GenericEventTest.php +++ b/src/Symfony/Component/EventDispatcher/Tests/GenericEventTest.php @@ -18,7 +18,6 @@ use Symfony\Component\EventDispatcher\GenericEvent; */ class GenericEventTest extends \PHPUnit_Framework_TestCase { - /** * @var GenericEvent */ diff --git a/src/Symfony/Component/Filesystem/Exception/ExceptionInterface.php b/src/Symfony/Component/Filesystem/Exception/ExceptionInterface.php index bc9748d752..c212e664d4 100644 --- a/src/Symfony/Component/Filesystem/Exception/ExceptionInterface.php +++ b/src/Symfony/Component/Filesystem/Exception/ExceptionInterface.php @@ -20,5 +20,4 @@ namespace Symfony\Component\Filesystem\Exception; */ interface ExceptionInterface { - } diff --git a/src/Symfony/Component/Filesystem/Exception/IOException.php b/src/Symfony/Component/Filesystem/Exception/IOException.php index 5b27e661ee..ae7e6ff9e5 100644 --- a/src/Symfony/Component/Filesystem/Exception/IOException.php +++ b/src/Symfony/Component/Filesystem/Exception/IOException.php @@ -20,5 +20,4 @@ namespace Symfony\Component\Filesystem\Exception; */ class IOException extends \RuntimeException implements ExceptionInterface { - } diff --git a/src/Symfony/Component/Filesystem/Tests/FilesystemTest.php b/src/Symfony/Component/Filesystem/Tests/FilesystemTest.php index 054ca7bbd4..76988d0e68 100644 --- a/src/Symfony/Component/Filesystem/Tests/FilesystemTest.php +++ b/src/Symfony/Component/Filesystem/Tests/FilesystemTest.php @@ -195,7 +195,7 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase { $basePath = $this->workspace.DIRECTORY_SEPARATOR; $directories = array( - $basePath.'1', $basePath.'2', $basePath.'3' + $basePath.'1', $basePath.'2', $basePath.'3', ); $this->filesystem->mkdir($directories); @@ -209,7 +209,7 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase { $basePath = $this->workspace.DIRECTORY_SEPARATOR; $directories = new \ArrayObject(array( - $basePath.'1', $basePath.'2', $basePath.'3' + $basePath.'1', $basePath.'2', $basePath.'3', )); $this->filesystem->mkdir($directories); @@ -255,7 +255,7 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase { $basePath = $this->workspace.DIRECTORY_SEPARATOR; $files = array( - $basePath.'1', $basePath.'2', $basePath.'3' + $basePath.'1', $basePath.'2', $basePath.'3', ); $this->filesystem->touch($files); @@ -269,7 +269,7 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase { $basePath = $this->workspace.DIRECTORY_SEPARATOR; $files = new \ArrayObject(array( - $basePath.'1', $basePath.'2', $basePath.'3' + $basePath.'1', $basePath.'2', $basePath.'3', )); $this->filesystem->touch($files); @@ -300,7 +300,7 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase touch($basePath.'file'); $files = array( - $basePath.'dir', $basePath.'file' + $basePath.'dir', $basePath.'file', ); $this->filesystem->remove($files); @@ -317,7 +317,7 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase touch($basePath.'file'); $files = new \ArrayObject(array( - $basePath.'dir', $basePath.'file' + $basePath.'dir', $basePath.'file', )); $this->filesystem->remove($files); @@ -333,7 +333,7 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase mkdir($basePath.'dir'); $files = array( - $basePath.'dir', $basePath.'file' + $basePath.'dir', $basePath.'file', ); $this->filesystem->remove($files); @@ -377,7 +377,7 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase touch($basePath.'file'); $files = new \ArrayObject(array( - $basePath.'dir', $basePath.'file' + $basePath.'dir', $basePath.'file', )); $this->assertTrue($this->filesystem->exists($files)); @@ -392,7 +392,7 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase touch($basePath.'file2'); $files = new \ArrayObject(array( - $basePath.'dir', $basePath.'file', $basePath.'file2' + $basePath.'dir', $basePath.'file', $basePath.'file2', )); unlink($basePath.'file'); @@ -906,7 +906,7 @@ class FilesystemTest extends \PHPUnit_Framework_TestCase array('var/lib', false), array('../var/lib', false), array('', false), - array(null, false) + array(null, false), ); } diff --git a/src/Symfony/Component/Finder/Adapter/AbstractFindAdapter.php b/src/Symfony/Component/Finder/Adapter/AbstractFindAdapter.php index 7f2a52fbcd..7fdd94be7b 100644 --- a/src/Symfony/Component/Finder/Adapter/AbstractFindAdapter.php +++ b/src/Symfony/Component/Finder/Adapter/AbstractFindAdapter.php @@ -247,7 +247,7 @@ abstract class AbstractFindAdapter extends AbstractAdapter $command->add('-size -'.($size->getTarget() + 1).'c'); break; case '>=': - $command->add('-size +'. ($size->getTarget() - 1).'c'); + $command->add('-size +'.($size->getTarget() - 1).'c'); break; case '>': $command->add('-size +'.$size->getTarget().'c'); diff --git a/src/Symfony/Component/Finder/Adapter/GnuFindAdapter.php b/src/Symfony/Component/Finder/Adapter/GnuFindAdapter.php index b72451ee18..0fbf48ffa4 100644 --- a/src/Symfony/Component/Finder/Adapter/GnuFindAdapter.php +++ b/src/Symfony/Component/Finder/Adapter/GnuFindAdapter.php @@ -80,7 +80,7 @@ class GnuFindAdapter extends AbstractFindAdapter */ protected function buildFindCommand(Command $command, $dir) { - return parent::buildFindCommand($command, $dir)->add('-regextype posix-extended'); + return parent::buildFindCommand($command, $dir)->add('-regextype posix-extended'); } /** diff --git a/src/Symfony/Component/Finder/Comparator/DateComparator.php b/src/Symfony/Component/Finder/Comparator/DateComparator.php index 9de444f052..8b7746badb 100644 --- a/src/Symfony/Component/Finder/Comparator/DateComparator.php +++ b/src/Symfony/Component/Finder/Comparator/DateComparator.php @@ -18,7 +18,6 @@ namespace Symfony\Component\Finder\Comparator; */ class DateComparator extends Comparator { - /** * Constructor. * diff --git a/src/Symfony/Component/Finder/Expression/Regex.php b/src/Symfony/Component/Finder/Expression/Regex.php index 2e8f507b48..c019d4a1a2 100644 --- a/src/Symfony/Component/Finder/Expression/Regex.php +++ b/src/Symfony/Component/Finder/Expression/Regex.php @@ -178,7 +178,7 @@ class Regex implements ValueInterface public function addOption($option) { if (!$this->hasOption($option)) { - $this->options.= $option; + $this->options .= $option; } return $this; diff --git a/src/Symfony/Component/Finder/Finder.php b/src/Symfony/Component/Finder/Finder.php index db4d851740..9dccf6e655 100644 --- a/src/Symfony/Component/Finder/Finder.php +++ b/src/Symfony/Component/Finder/Finder.php @@ -783,7 +783,8 @@ class Finder implements \IteratorAggregate, \Countable return $this ->buildAdapter($adapter['adapter']) ->searchInDirectory($dir); - } catch (ExceptionInterface $e) {} + } catch (ExceptionInterface $e) { + } } } diff --git a/src/Symfony/Component/Finder/Iterator/FilenameFilterIterator.php b/src/Symfony/Component/Finder/Iterator/FilenameFilterIterator.php index c4e0ccd8e4..886537c155 100644 --- a/src/Symfony/Component/Finder/Iterator/FilenameFilterIterator.php +++ b/src/Symfony/Component/Finder/Iterator/FilenameFilterIterator.php @@ -20,7 +20,6 @@ use Symfony\Component\Finder\Expression\Expression; */ class FilenameFilterIterator extends MultiplePcreFilterIterator { - /** * Filters the iterator values. * diff --git a/src/Symfony/Component/Finder/Iterator/PathFilterIterator.php b/src/Symfony/Component/Finder/Iterator/PathFilterIterator.php index 828fa41876..db86faa2c9 100644 --- a/src/Symfony/Component/Finder/Iterator/PathFilterIterator.php +++ b/src/Symfony/Component/Finder/Iterator/PathFilterIterator.php @@ -19,7 +19,6 @@ namespace Symfony\Component\Finder\Iterator; */ class PathFilterIterator extends MultiplePcreFilterIterator { - /** * Filters the iterator values. * diff --git a/src/Symfony/Component/Finder/Tests/Comparator/DateComparatorTest.php b/src/Symfony/Component/Finder/Tests/Comparator/DateComparatorTest.php index ac8256ab86..273912635e 100644 --- a/src/Symfony/Component/Finder/Tests/Comparator/DateComparatorTest.php +++ b/src/Symfony/Component/Finder/Tests/Comparator/DateComparatorTest.php @@ -59,6 +59,5 @@ class DateComparatorTest extends \PHPUnit_Framework_TestCase array('since 2005-10-10', array(strtotime('2005-10-15')), array(strtotime('2005-10-09'))), array('!= 2005-10-10', array(strtotime('2005-10-11')), array(strtotime('2005-10-10'))), ); - } } diff --git a/src/Symfony/Component/Finder/Tests/Comparator/NumberComparatorTest.php b/src/Symfony/Component/Finder/Tests/Comparator/NumberComparatorTest.php index b07870ba81..d8cef1b5b4 100644 --- a/src/Symfony/Component/Finder/Tests/Comparator/NumberComparatorTest.php +++ b/src/Symfony/Component/Finder/Tests/Comparator/NumberComparatorTest.php @@ -15,7 +15,6 @@ use Symfony\Component\Finder\Comparator\NumberComparator; class NumberComparatorTest extends \PHPUnit_Framework_TestCase { - /** * @dataProvider getConstructorTestData */ @@ -101,9 +100,8 @@ class NumberComparatorTest extends \PHPUnit_Framework_TestCase '=1', '===1', '0 . 1', '123 .45', '234. 567', '..', '.0.', '0.1.2', - ) + ), ), ); } - } diff --git a/src/Symfony/Component/Finder/Tests/FinderTest.php b/src/Symfony/Component/Finder/Tests/FinderTest.php index 598821d24f..0711f7e7a3 100644 --- a/src/Symfony/Component/Finder/Tests/FinderTest.php +++ b/src/Symfony/Component/Finder/Tests/FinderTest.php @@ -673,7 +673,7 @@ class FinderTest extends Iterator\RealIteratorTestCase $tests = array( array('', '', array()), array('/^A\/B\/C/', '/C$/', - array('A'.DIRECTORY_SEPARATOR.'B'.DIRECTORY_SEPARATOR.'C'.DIRECTORY_SEPARATOR.'abc.dat') + array('A'.DIRECTORY_SEPARATOR.'B'.DIRECTORY_SEPARATOR.'C'.DIRECTORY_SEPARATOR.'abc.dat'), ), array('/^A\/B/', 'foobar', array( @@ -681,7 +681,7 @@ class FinderTest extends Iterator\RealIteratorTestCase 'A'.DIRECTORY_SEPARATOR.'B'.DIRECTORY_SEPARATOR.'C', 'A'.DIRECTORY_SEPARATOR.'B'.DIRECTORY_SEPARATOR.'ab.dat', 'A'.DIRECTORY_SEPARATOR.'B'.DIRECTORY_SEPARATOR.'C'.DIRECTORY_SEPARATOR.'abc.dat', - ) + ), ), array('A/B/C', 'foobar', array( @@ -689,7 +689,7 @@ class FinderTest extends Iterator\RealIteratorTestCase 'A'.DIRECTORY_SEPARATOR.'B'.DIRECTORY_SEPARATOR.'C'.DIRECTORY_SEPARATOR.'abc.dat', 'copy'.DIRECTORY_SEPARATOR.'A'.DIRECTORY_SEPARATOR.'B'.DIRECTORY_SEPARATOR.'C', 'copy'.DIRECTORY_SEPARATOR.'A'.DIRECTORY_SEPARATOR.'B'.DIRECTORY_SEPARATOR.'C'.DIRECTORY_SEPARATOR.'abc.dat.copy', - ) + ), ), array('A/B', 'foobar', array( @@ -703,12 +703,12 @@ class FinderTest extends Iterator\RealIteratorTestCase 'A'.DIRECTORY_SEPARATOR.'B'.DIRECTORY_SEPARATOR.'C'.DIRECTORY_SEPARATOR.'abc.dat', 'copy'.DIRECTORY_SEPARATOR.'A'.DIRECTORY_SEPARATOR.'B'.DIRECTORY_SEPARATOR.'ab.dat.copy', 'copy'.DIRECTORY_SEPARATOR.'A'.DIRECTORY_SEPARATOR.'B'.DIRECTORY_SEPARATOR.'C'.DIRECTORY_SEPARATOR.'abc.dat.copy', - ) + ), ), array('/^with space\//', 'foobar', array( 'with space'.DIRECTORY_SEPARATOR.'foo.txt', - ) + ), ), ); @@ -808,7 +808,7 @@ class FinderTest extends Iterator\RealIteratorTestCase array( new Adapter\BsdFindAdapter(), new Adapter\GnuFindAdapter(), - new Adapter\PhpAdapter() + new Adapter\PhpAdapter(), ), function (Adapter\AdapterInterface $adapter) { return $adapter->isSupported(); diff --git a/src/Symfony/Component/Finder/Tests/Iterator/DepthRangeFilterIteratorTest.php b/src/Symfony/Component/Finder/Tests/Iterator/DepthRangeFilterIteratorTest.php index be06f1cdd3..5ec983247d 100644 --- a/src/Symfony/Component/Finder/Tests/Iterator/DepthRangeFilterIteratorTest.php +++ b/src/Symfony/Component/Finder/Tests/Iterator/DepthRangeFilterIteratorTest.php @@ -77,5 +77,4 @@ class DepthRangeFilterIteratorTest extends RealIteratorTestCase array(1, 1, $this->toAbsolute($equalTo1)), ); } - } diff --git a/src/Symfony/Component/Finder/Tests/Iterator/ExcludeDirectoryFilterIteratorTest.php b/src/Symfony/Component/Finder/Tests/Iterator/ExcludeDirectoryFilterIteratorTest.php index e299fe731f..693b73319a 100644 --- a/src/Symfony/Component/Finder/Tests/Iterator/ExcludeDirectoryFilterIteratorTest.php +++ b/src/Symfony/Component/Finder/Tests/Iterator/ExcludeDirectoryFilterIteratorTest.php @@ -39,7 +39,7 @@ class ExcludeDirectoryFilterIteratorTest extends RealIteratorTestCase 'test.py', 'test.php', 'toto', - 'foo bar' + 'foo bar', ); $fo = array( @@ -53,7 +53,7 @@ class ExcludeDirectoryFilterIteratorTest extends RealIteratorTestCase 'foo/bar.tmp', 'test.php', 'toto', - 'foo bar' + 'foo bar', ); return array( @@ -61,5 +61,4 @@ class ExcludeDirectoryFilterIteratorTest extends RealIteratorTestCase array(array('fo'), $this->toAbsolute($fo)), ); } - } diff --git a/src/Symfony/Component/Finder/Tests/Iterator/FilePathsIteratorTest.php b/src/Symfony/Component/Finder/Tests/Iterator/FilePathsIteratorTest.php index 61f0e9b229..d2f0e245f6 100644 --- a/src/Symfony/Component/Finder/Tests/Iterator/FilePathsIteratorTest.php +++ b/src/Symfony/Component/Finder/Tests/Iterator/FilePathsIteratorTest.php @@ -42,7 +42,7 @@ class FilePathsIteratorTest extends RealIteratorTestCase $tmpDir.DIRECTORY_SEPARATOR.'foo' => $tmpDir.DIRECTORY_SEPARATOR.'foo', $tmpDir.DIRECTORY_SEPARATOR.'foo'.DIRECTORY_SEPARATOR.'bar.tmp' => $tmpDir.DIRECTORY_SEPARATOR.'foo'.DIRECTORY_SEPARATOR.'bar.tmp', $tmpDir.DIRECTORY_SEPARATOR.'test.php' => $tmpDir.DIRECTORY_SEPARATOR.'test.php', - $tmpDir.DIRECTORY_SEPARATOR.'toto' => $tmpDir.DIRECTORY_SEPARATOR.'toto' + $tmpDir.DIRECTORY_SEPARATOR.'toto' => $tmpDir.DIRECTORY_SEPARATOR.'toto', ), array( // subPaths $tmpDir.DIRECTORY_SEPARATOR.'.git' => '', @@ -50,7 +50,7 @@ class FilePathsIteratorTest extends RealIteratorTestCase $tmpDir.DIRECTORY_SEPARATOR.'foo' => '', $tmpDir.DIRECTORY_SEPARATOR.'foo'.DIRECTORY_SEPARATOR.'bar.tmp' => 'foo', $tmpDir.DIRECTORY_SEPARATOR.'test.php' => '', - $tmpDir.DIRECTORY_SEPARATOR.'toto' => '' + $tmpDir.DIRECTORY_SEPARATOR.'toto' => '', ), array( // subPathnames $tmpDir.DIRECTORY_SEPARATOR.'.git' => '.git', @@ -58,7 +58,7 @@ class FilePathsIteratorTest extends RealIteratorTestCase $tmpDir.DIRECTORY_SEPARATOR.'foo' => 'foo', $tmpDir.DIRECTORY_SEPARATOR.'foo'.DIRECTORY_SEPARATOR.'bar.tmp' => 'foo'.DIRECTORY_SEPARATOR.'bar.tmp', $tmpDir.DIRECTORY_SEPARATOR.'test.php' => 'test.php', - $tmpDir.DIRECTORY_SEPARATOR.'toto' => 'toto' + $tmpDir.DIRECTORY_SEPARATOR.'toto' => 'toto', ), ), ); diff --git a/src/Symfony/Component/Finder/Tests/Iterator/FileTypeFilterIteratorTest.php b/src/Symfony/Component/Finder/Tests/Iterator/FileTypeFilterIteratorTest.php index b2432ca3ff..cfa8684fdf 100644 --- a/src/Symfony/Component/Finder/Tests/Iterator/FileTypeFilterIteratorTest.php +++ b/src/Symfony/Component/Finder/Tests/Iterator/FileTypeFilterIteratorTest.php @@ -55,7 +55,7 @@ class FileTypeFilterIteratorTest extends RealIteratorTestCase class InnerTypeIterator extends \ArrayIterator { - public function current() + public function current() { return new \SplFileInfo(parent::current()); } diff --git a/src/Symfony/Component/Finder/Tests/Iterator/FilecontentFilterIteratorTest.php b/src/Symfony/Component/Finder/Tests/Iterator/FilecontentFilterIteratorTest.php index dbc05b5ece..d3be8c6489 100644 --- a/src/Symfony/Component/Finder/Tests/Iterator/FilecontentFilterIteratorTest.php +++ b/src/Symfony/Component/Finder/Tests/Iterator/FilecontentFilterIteratorTest.php @@ -15,7 +15,6 @@ use Symfony\Component\Finder\Iterator\FilecontentFilterIterator; class FilecontentFilterIteratorTest extends IteratorTestCase { - public function testAccept() { $inner = new MockFileListIterator(array('test.txt')); @@ -54,28 +53,28 @@ class FilecontentFilterIteratorTest extends IteratorTestCase 'name' => 'a.txt', 'contents' => 'Lorem ipsum...', 'type' => 'file', - 'mode' => 'r+') + 'mode' => 'r+',) ); $inner[] = new MockSplFileInfo(array( 'name' => 'b.yml', 'contents' => 'dolor sit...', 'type' => 'file', - 'mode' => 'r+') + 'mode' => 'r+',) ); $inner[] = new MockSplFileInfo(array( 'name' => 'some/other/dir/third.php', 'contents' => 'amet...', 'type' => 'file', - 'mode' => 'r+') + 'mode' => 'r+',) ); $inner[] = new MockSplFileInfo(array( 'name' => 'unreadable-file.txt', 'contents' => false, 'type' => 'file', - 'mode' => 'r+') + 'mode' => 'r+',) ); return array( diff --git a/src/Symfony/Component/Finder/Tests/Iterator/PathFilterIteratorTest.php b/src/Symfony/Component/Finder/Tests/Iterator/PathFilterIteratorTest.php index 6f83e44029..c64ec2b1f5 100644 --- a/src/Symfony/Component/Finder/Tests/Iterator/PathFilterIteratorTest.php +++ b/src/Symfony/Component/Finder/Tests/Iterator/PathFilterIteratorTest.php @@ -15,7 +15,6 @@ use Symfony\Component\Finder\Iterator\PathFilterIterator; class PathFilterIteratorTest extends IteratorTestCase { - /** * @dataProvider getTestFilterData */ @@ -81,5 +80,4 @@ class PathFilterIteratorTest extends IteratorTestCase ); } - } diff --git a/src/Symfony/Component/Finder/Tests/Iterator/RealIteratorTestCase.php b/src/Symfony/Component/Finder/Tests/Iterator/RealIteratorTestCase.php index 65edb1e465..8aa5c89d82 100644 --- a/src/Symfony/Component/Finder/Tests/Iterator/RealIteratorTestCase.php +++ b/src/Symfony/Component/Finder/Tests/Iterator/RealIteratorTestCase.php @@ -13,7 +13,6 @@ namespace Symfony\Component\Finder\Tests\Iterator; abstract class RealIteratorTestCase extends IteratorTestCase { - protected static $tmpDir; protected static $files; @@ -32,7 +31,7 @@ abstract class RealIteratorTestCase extends IteratorTestCase 'foo/bar.tmp', 'test.php', 'toto/', - 'foo bar' + 'foo bar', ); self::$files = self::toAbsolute(self::$files); @@ -103,5 +102,4 @@ abstract class RealIteratorTestCase extends IteratorTestCase return $f; } - } diff --git a/src/Symfony/Component/Finder/Tests/Iterator/SizeRangeFilterIteratorTest.php b/src/Symfony/Component/Finder/Tests/Iterator/SizeRangeFilterIteratorTest.php index 726df9e300..8780db4da1 100644 --- a/src/Symfony/Component/Finder/Tests/Iterator/SizeRangeFilterIteratorTest.php +++ b/src/Symfony/Component/Finder/Tests/Iterator/SizeRangeFilterIteratorTest.php @@ -46,7 +46,7 @@ class SizeRangeFilterIteratorTest extends RealIteratorTestCase class InnerSizeIterator extends \ArrayIterator { - public function current() + public function current() { return new \SplFileInfo(parent::current()); } diff --git a/src/Symfony/Component/Finder/Tests/Iterator/SortableIteratorTest.php b/src/Symfony/Component/Finder/Tests/Iterator/SortableIteratorTest.php index a2ca6ef376..f4def17a18 100644 --- a/src/Symfony/Component/Finder/Tests/Iterator/SortableIteratorTest.php +++ b/src/Symfony/Component/Finder/Tests/Iterator/SortableIteratorTest.php @@ -59,7 +59,6 @@ class SortableIteratorTest extends RealIteratorTestCase public function getAcceptData() { - $sortByName = array( '.bar', '.foo', @@ -113,7 +112,7 @@ class SortableIteratorTest extends RealIteratorTestCase '.foo/.bar', '.foo/bar', '.git', - '.bar' + '.bar', ); $sortByChangedTime = array( @@ -127,7 +126,7 @@ class SortableIteratorTest extends RealIteratorTestCase '.foo/.bar', '.foo/bar', 'test.php', - 'test.py' + 'test.py', ); $sortByModifiedTime = array( @@ -141,7 +140,7 @@ class SortableIteratorTest extends RealIteratorTestCase '.foo/.bar', '.foo/bar', 'test.php', - 'test.py' + 'test.py', ); return array( diff --git a/src/Symfony/Component/Form/Extension/Core/DataMapper/PropertyPathMapper.php b/src/Symfony/Component/Form/Extension/Core/DataMapper/PropertyPathMapper.php index d07f3f15e6..2208f26d1e 100644 --- a/src/Symfony/Component/Form/Extension/Core/DataMapper/PropertyPathMapper.php +++ b/src/Symfony/Component/Form/Extension/Core/DataMapper/PropertyPathMapper.php @@ -81,7 +81,6 @@ class PropertyPathMapper implements DataMapperInterface // Write-back is disabled if the form is not synchronized (transformation failed), // if the form was not submitted and if the form is disabled (modification not allowed) if (null !== $propertyPath && $config->getMapped() && $form->isSubmitted() && $form->isSynchronized() && !$form->isDisabled()) { - // If the field is of type DateTime and the data is the same skip the update to // keep the original object hash if ($form->getData() instanceof \DateTime && $form->getData() == $this->propertyAccessor->getValue($data, $propertyPath)) { diff --git a/src/Symfony/Component/Form/Extension/Core/DataTransformer/BooleanToStringTransformer.php b/src/Symfony/Component/Form/Extension/Core/DataTransformer/BooleanToStringTransformer.php index d839427877..38c9bb273b 100644 --- a/src/Symfony/Component/Form/Extension/Core/DataTransformer/BooleanToStringTransformer.php +++ b/src/Symfony/Component/Form/Extension/Core/DataTransformer/BooleanToStringTransformer.php @@ -81,5 +81,4 @@ class BooleanToStringTransformer implements DataTransformerInterface return true; } - } diff --git a/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToStringTransformer.php b/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToStringTransformer.php index a9ea5e761f..11ffd3791d 100644 --- a/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToStringTransformer.php +++ b/src/Symfony/Component/Form/Extension/Core/DataTransformer/DateTimeToStringTransformer.php @@ -161,16 +161,16 @@ class DateTimeToStringTransformer extends BaseDateTimeTransformer // Check which of the date parts are present in the pattern preg_match( - '/(' . - '(?P[djDl])|' . - '(?P[FMmn])|' . - '(?P[Yy])|' . - '(?P[ghGH])|' . - '(?Pi)|' . - '(?Ps)|' . - '(?Pz)|' . - '(?PU)|' . - '[^djDlFMmnYyghGHiszU]' . + '/('. + '(?P[djDl])|'. + '(?P[FMmn])|'. + '(?P[Yy])|'. + '(?P[ghGH])|'. + '(?Pi)|'. + '(?Ps)|'. + '(?Pz)|'. + '(?PU)|'. + '[^djDlFMmnYyghGHiszU]'. ')*/', $this->parseFormat, $matches diff --git a/src/Symfony/Component/Form/Extension/Core/DataTransformer/MoneyToLocalizedStringTransformer.php b/src/Symfony/Component/Form/Extension/Core/DataTransformer/MoneyToLocalizedStringTransformer.php index d746961d2d..d70c08a8aa 100644 --- a/src/Symfony/Component/Form/Extension/Core/DataTransformer/MoneyToLocalizedStringTransformer.php +++ b/src/Symfony/Component/Form/Extension/Core/DataTransformer/MoneyToLocalizedStringTransformer.php @@ -85,5 +85,4 @@ class MoneyToLocalizedStringTransformer extends NumberToLocalizedStringTransform return $value; } - } diff --git a/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php b/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php index 712f5b6de8..08504dea2b 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/ChoiceType.php @@ -159,7 +159,7 @@ class ChoiceType extends AbstractType */ public function setDefaultOptions(OptionsResolverInterface $resolver) { - $choiceListCache =& $this->choiceListCache; + $choiceListCache = & $this->choiceListCache; $choiceList = function (Options $options) use (&$choiceListCache) { // Harden against NULL values (like in EntityType and ModelType) diff --git a/src/Symfony/Component/Form/Extension/Core/Type/DateType.php b/src/Symfony/Component/Form/Extension/Core/Type/DateType.php index 1748d2e31f..6d90e55714 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/DateType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/DateType.php @@ -187,7 +187,7 @@ class DateType extends AbstractType return array( 'year' => $emptyValue, 'month' => $emptyValue, - 'day' => $emptyValue + 'day' => $emptyValue, ); }; diff --git a/src/Symfony/Component/Form/Extension/Core/Type/TimeType.php b/src/Symfony/Component/Form/Extension/Core/Type/TimeType.php index 6bf41517ac..3585b5bd31 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/TimeType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/TimeType.php @@ -177,7 +177,7 @@ class TimeType extends AbstractType return array( 'hour' => $emptyValue, 'minute' => $emptyValue, - 'second' => $emptyValue + 'second' => $emptyValue, ); }; diff --git a/src/Symfony/Component/Form/Extension/Templating/TemplatingExtension.php b/src/Symfony/Component/Form/Extension/Templating/TemplatingExtension.php index 573cb518d4..1e56f0c6b6 100644 --- a/src/Symfony/Component/Form/Extension/Templating/TemplatingExtension.php +++ b/src/Symfony/Component/Form/Extension/Templating/TemplatingExtension.php @@ -27,7 +27,7 @@ class TemplatingExtension extends AbstractExtension public function __construct(PhpEngine $engine, CsrfProviderInterface $csrfProvider = null, array $defaultThemes = array()) { $engine->addHelpers(array( - new FormHelper(new FormRenderer(new TemplatingRendererEngine($engine, $defaultThemes), $csrfProvider)) + new FormHelper(new FormRenderer(new TemplatingRendererEngine($engine, $defaultThemes), $csrfProvider)), )); } } diff --git a/src/Symfony/Component/Form/Extension/Validator/Util/ServerParams.php b/src/Symfony/Component/Form/Extension/Validator/Util/ServerParams.php index 93a1dd7d6f..58fdc25e22 100644 --- a/src/Symfony/Component/Form/Extension/Validator/Util/ServerParams.php +++ b/src/Symfony/Component/Form/Extension/Validator/Util/ServerParams.php @@ -69,5 +69,4 @@ class ServerParams ? (int) $_SERVER['CONTENT_LENGTH'] : null; } - } diff --git a/src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php b/src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php index 63d06dca71..589fc12a36 100644 --- a/src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php +++ b/src/Symfony/Component/Form/Extension/Validator/ValidatorTypeGuesser.php @@ -196,7 +196,7 @@ class ValidatorTypeGuesser implements FormTypeGuesserInterface case 'Symfony\Component\Validator\Constraints\Type': if (in_array($constraint->type, array('double', 'float', 'numeric', 'real'))) { - return new ValueGuess(null, Guess::MEDIUM_CONFIDENCE); + return new ValueGuess(null, Guess::MEDIUM_CONFIDENCE); } break; diff --git a/src/Symfony/Component/Form/Form.php b/src/Symfony/Component/Form/Form.php index a94a679f9d..3f3fe88241 100644 --- a/src/Symfony/Component/Form/Form.php +++ b/src/Symfony/Component/Form/Form.php @@ -351,20 +351,20 @@ class Form implements \IteratorAggregate, FormInterface $expectedType = 'scalar, array or an instance of \ArrayAccess'; throw new LogicException( - 'The form\'s view data is expected to be of type '.$expectedType.', ' . - 'but is '.$actualType.'. You ' . - 'can avoid this error by setting the "data_class" option to ' . - '"'.get_class($viewData).'" or by adding a view transformer ' . + 'The form\'s view data is expected to be of type '.$expectedType.', '. + 'but is '.$actualType.'. You '. + 'can avoid this error by setting the "data_class" option to '. + '"'.get_class($viewData).'" or by adding a view transformer '. 'that transforms '.$actualType.' to '.$expectedType.'.' ); } if (null !== $dataClass && !$viewData instanceof $dataClass) { throw new LogicException( - 'The form\'s view data is expected to be an instance of class ' . - $dataClass.', but is '. $actualType.'. You can avoid this error ' . - 'by setting the "data_class" option to null or by adding a view ' . - 'transformer that transforms '.$actualType.' to an instance of ' . + 'The form\'s view data is expected to be an instance of class '. + $dataClass.', but is '.$actualType.'. You can avoid this error '. + 'by setting the "data_class" option to null or by adding a view '. + 'transformer that transforms '.$actualType.' to an instance of '. $dataClass.'.' ); } diff --git a/src/Symfony/Component/Form/FormConfigBuilder.php b/src/Symfony/Component/Form/FormConfigBuilder.php index 733b79dfdd..1d70a49644 100644 --- a/src/Symfony/Component/Form/FormConfigBuilder.php +++ b/src/Symfony/Component/Form/FormConfigBuilder.php @@ -44,7 +44,7 @@ class FormConfigBuilder implements FormConfigBuilderInterface 'PUT', 'POST', 'DELETE', - 'PATCH' + 'PATCH', ); /** diff --git a/src/Symfony/Component/Form/NativeRequestHandler.php b/src/Symfony/Component/Form/NativeRequestHandler.php index c76534473c..fefe546af8 100644 --- a/src/Symfony/Component/Form/NativeRequestHandler.php +++ b/src/Symfony/Component/Form/NativeRequestHandler.php @@ -155,7 +155,7 @@ class NativeRequestHandler implements RequestHandlerInterface 'name' => $data['name'][$key], 'type' => $data['type'][$key], 'tmp_name' => $data['tmp_name'][$key], - 'size' => $data['size'][$key] + 'size' => $data['size'][$key], )); } diff --git a/src/Symfony/Component/Form/Tests/AbstractDivLayoutTest.php b/src/Symfony/Component/Form/Tests/AbstractDivLayoutTest.php index ee9ed8f2a6..21ea55833a 100644 --- a/src/Symfony/Component/Form/Tests/AbstractDivLayoutTest.php +++ b/src/Symfony/Component/Form/Tests/AbstractDivLayoutTest.php @@ -525,7 +525,7 @@ abstract class AbstractDivLayoutTest extends AbstractLayoutTest $form = $this->factory->createNamed('name', 'repeated', null, array( // the global required value cannot be overridden 'first_options' => array('label' => 'Test', 'required' => false), - 'second_options' => array('label' => 'Test2') + 'second_options' => array('label' => 'Test2'), )); $this->assertWidgetMatchesXpath($form->createView(), array(), @@ -587,7 +587,7 @@ abstract class AbstractDivLayoutTest extends AbstractLayoutTest public function testLabelIsNotRenderedWhenSetToFalse() { $form = $this->factory->createNamed('name', 'text', null, array( - 'label' => false + 'label' => false, )); $html = $this->renderRow($form->createView()); @@ -698,7 +698,7 @@ abstract class AbstractDivLayoutTest extends AbstractLayoutTest $html = $this->renderEnd($view); // Insert the start tag, the end tag should be rendered by the helper - $this->assertMatchesXpath('' . $html, + $this->assertMatchesXpath(''.$html, '/form [ ./div diff --git a/src/Symfony/Component/Form/Tests/AbstractLayoutTest.php b/src/Symfony/Component/Form/Tests/AbstractLayoutTest.php index 9e3647a2b2..5439bd096f 100644 --- a/src/Symfony/Component/Form/Tests/AbstractLayoutTest.php +++ b/src/Symfony/Component/Form/Tests/AbstractLayoutTest.php @@ -215,7 +215,7 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg $form = $this->factory->createNamed('name', 'text'); $html = $this->renderLabel($form->createView(), null, array( 'attr' => array( - 'class' => 'my&class' + 'class' => 'my&class', ), )); @@ -232,7 +232,7 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg $form = $this->factory->createNamed('name', 'text'); $html = $this->renderLabel($form->createView(), null, array( 'label_attr' => array( - 'class' => 'my&class' + 'class' => 'my&class', ), )); @@ -249,7 +249,7 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg $form = $this->factory->createNamed('name', 'text'); $html = $this->renderLabel($form->createView(), 'Custom label', array( 'label_attr' => array( - 'class' => 'my&class' + 'class' => 'my&class', ), )); @@ -270,7 +270,7 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg )); $html = $this->renderLabel($form->createView(), null, array( 'label_attr' => array( - 'class' => 'my&class' + 'class' => 'my&class', ), )); @@ -555,7 +555,7 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg 'required' => true, 'multiple' => false, 'expanded' => false, - 'empty_value' => 'Test&Me' + 'empty_value' => 'Test&Me', )); // The "disabled" attribute was removed again due to a bug in the @@ -660,7 +660,7 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), 'multiple' => true, 'expanded' => false, - 'empty_value' => 'Test&Me' + 'empty_value' => 'Test&Me', )); $this->assertWidgetMatchesXpath($form->createView(), array(), @@ -726,7 +726,7 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg 'choices' => array('&a' => 'Choice&A', '&b' => 'Choice&B'), 'multiple' => false, 'expanded' => true, - 'empty_value' => 'Test&Me' + 'empty_value' => 'Test&Me', )); $this->assertWidgetMatchesXpath($form->createView(), array(), @@ -1825,7 +1825,7 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg { $form = $this->factory->create('form', null, array( 'method' => 'get', - 'action' => 'http://example.com/directory' + 'action' => 'http://example.com/directory', )); $html = $this->renderStart($form->createView()); @@ -1837,12 +1837,12 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg { $form = $this->factory->create('form', null, array( 'method' => 'put', - 'action' => 'http://example.com/directory' + 'action' => 'http://example.com/directory', )); $html = $this->renderStart($form->createView()); - $this->assertMatchesXpath($html . '', + $this->assertMatchesXpath($html.'', '/form [./input[@type="hidden"][@name="_method"][@value="PUT"]] [@method="post"] @@ -1859,7 +1859,7 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg $html = $this->renderStart($form->createView(), array( 'method' => 'post', - 'action' => 'http://foo.com/directory' + 'action' => 'http://foo.com/directory', )); $this->assertSame('
', $html); @@ -1869,7 +1869,7 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg { $form = $this->factory->createBuilder('form', null, array( 'method' => 'get', - 'action' => 'http://example.com/directory' + 'action' => 'http://example.com/directory', )) ->add('file', 'file') ->getForm(); @@ -1883,7 +1883,7 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg { $form = $this->factory->create('form', null, array( 'method' => 'get', - 'action' => 'http://example.com/directory' + 'action' => 'http://example.com/directory', )); $html = $this->renderStart($form->createView(), array( diff --git a/src/Symfony/Component/Form/Tests/AbstractTableLayoutTest.php b/src/Symfony/Component/Form/Tests/AbstractTableLayoutTest.php index 5c91195169..25fa504a53 100644 --- a/src/Symfony/Component/Form/Tests/AbstractTableLayoutTest.php +++ b/src/Symfony/Component/Form/Tests/AbstractTableLayoutTest.php @@ -42,7 +42,7 @@ abstract class AbstractTableLayoutTest extends AbstractLayoutTest public function testLabelIsNotRenderedWhenSetToFalse() { $form = $this->factory->createNamed('name', 'text', null, array( - 'label' => false + 'label' => false, )); $html = $this->renderRow($form->createView()); @@ -401,7 +401,7 @@ abstract class AbstractTableLayoutTest extends AbstractLayoutTest $form = $this->factory->createNamed('name', 'repeated', 'foobar', array( 'type' => 'password', 'first_options' => array('label' => 'Test', 'required' => false), - 'second_options' => array('label' => 'Test2') + 'second_options' => array('label' => 'Test2'), )); $this->assertWidgetMatchesXpath($form->createView(), array(), @@ -471,7 +471,7 @@ abstract class AbstractTableLayoutTest extends AbstractLayoutTest // tag is missing. If someone renders a form with table layout // manually, she should call form_rest() explicitly within the // tag. - $this->assertMatchesXpath('' . $html, + $this->assertMatchesXpath(''.$html, '/form [ ./tr diff --git a/src/Symfony/Component/Form/Tests/CallbackTransformerTest.php b/src/Symfony/Component/Form/Tests/CallbackTransformerTest.php index 706bc076ec..7f3b074e78 100644 --- a/src/Symfony/Component/Form/Tests/CallbackTransformerTest.php +++ b/src/Symfony/Component/Form/Tests/CallbackTransformerTest.php @@ -9,8 +9,8 @@ class CallbackTransformerTest extends \PHPUnit_Framework_TestCase public function testTransform() { $transformer = new CallbackTransformer( - function($value) { return $value.' has been transformed'; }, - function($value) { return $value.' has reversely been transformed'; } + function ($value) { return $value.' has been transformed'; }, + function ($value) { return $value.' has reversely been transformed'; } ); $this->assertEquals('foo has been transformed', $transformer->transform('foo')); @@ -30,8 +30,8 @@ class CallbackTransformerTest extends \PHPUnit_Framework_TestCase public function invalidCallbacksProvider() { return array( - array( null, function(){} ), - array( function(){}, null ), + array( null, function () {} ), + array( function () {}, null ), ); } } diff --git a/src/Symfony/Component/Form/Tests/CompoundFormTest.php b/src/Symfony/Component/Form/Tests/CompoundFormTest.php index 565b6ce646..17c4f3b0bf 100644 --- a/src/Symfony/Component/Form/Tests/CompoundFormTest.php +++ b/src/Symfony/Component/Form/Tests/CompoundFormTest.php @@ -794,7 +794,7 @@ class CompoundFormTest extends AbstractFormTest $values = array( 'firstName' => 'Bernhard', 'lastName' => 'Schussek', - 'extra' => 'data' + 'extra' => 'data', ); $request = new Request($values, array(), array(), array(), array(), array( diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/ChoiceListTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/ChoiceListTest.php index 59f002d8cc..538bbc1b3d 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/ChoiceListTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/ChoiceListTest.php @@ -60,7 +60,7 @@ class ChoiceListTest extends AbstractChoiceListTest $this->list = new ChoiceList( new \ArrayIterator(array( 'Group' => array($this->obj1, $this->obj2), - 'Not a Group' => $traversableChoice + 'Not a Group' => $traversableChoice, )), array( 'Group' => array('A', 'B'), @@ -72,11 +72,11 @@ class ChoiceListTest extends AbstractChoiceListTest $this->assertSame(array($this->obj1, $this->obj2, $traversableChoice), $this->list->getChoices()); $this->assertSame(array('0', '1', '2'), $this->list->getValues()); $this->assertEquals(array( - 'Group' => array(1 => new ChoiceView($this->obj2, '1', 'B')) + 'Group' => array(1 => new ChoiceView($this->obj2, '1', 'B')), ), $this->list->getPreferredViews()); $this->assertEquals(array( 'Group' => array(0 => new ChoiceView($this->obj1, '0', 'A')), - 2 => new ChoiceView($traversableChoice, '2', 'C') + 2 => new ChoiceView($traversableChoice, '2', 'C'), ), $this->list->getRemainingViews()); } @@ -86,11 +86,11 @@ class ChoiceListTest extends AbstractChoiceListTest $this->assertSame(array('0', '1', '2', '3'), $this->list->getValues()); $this->assertEquals(array( 'Group 1' => array(1 => new ChoiceView($this->obj2, '1', 'B')), - 'Group 2' => array(2 => new ChoiceView($this->obj3, '2', 'C')) + 'Group 2' => array(2 => new ChoiceView($this->obj3, '2', 'C')), ), $this->list->getPreferredViews()); $this->assertEquals(array( 'Group 1' => array(0 => new ChoiceView($this->obj1, '0', 'A')), - 'Group 2' => array(3 => new ChoiceView($this->obj4, '3', 'D')) + 'Group 2' => array(3 => new ChoiceView($this->obj4, '3', 'D')), ), $this->list->getRemainingViews()); } diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/ObjectChoiceListTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/ObjectChoiceListTest.php index 27effd9f5c..2040dfd9e1 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/ObjectChoiceListTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/ObjectChoiceListTest.php @@ -69,11 +69,11 @@ class ObjectChoiceListTest extends AbstractChoiceListTest $this->assertSame(array('0', '1', '2', '3'), $this->list->getValues()); $this->assertEquals(array( 'Group 1' => array(1 => new ChoiceView($this->obj2, '1', 'B')), - 'Group 2' => array(2 => new ChoiceView($this->obj3, '2', 'C')) + 'Group 2' => array(2 => new ChoiceView($this->obj3, '2', 'C')), ), $this->list->getPreferredViews()); $this->assertEquals(array( 'Group 1' => array(0 => new ChoiceView($this->obj1, '0', 'A')), - 'Group 2' => array(3 => new ChoiceView($this->obj4, '3', 'D')) + 'Group 2' => array(3 => new ChoiceView($this->obj4, '3', 'D')), ), $this->list->getRemainingViews()); } @@ -102,7 +102,7 @@ class ObjectChoiceListTest extends AbstractChoiceListTest $this->assertSame(array('0', '1', '2', '3', '4', '5'), $this->list->getValues()); $this->assertEquals(array( 'Group 1' => array(1 => new ChoiceView($this->obj2, '1', 'B')), - 'Group 2' => array(2 => new ChoiceView($this->obj3, '2', 'C')) + 'Group 2' => array(2 => new ChoiceView($this->obj3, '2', 'C')), ), $this->list->getPreferredViews()); $this->assertEquals(array( 'Group 1' => array(0 => new ChoiceView($this->obj1, '0', 'A')), diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/SimpleChoiceListTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/SimpleChoiceListTest.php index 838a8e0864..3a5804ef28 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/SimpleChoiceListTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/ChoiceList/SimpleChoiceListTest.php @@ -33,11 +33,11 @@ class SimpleChoiceListTest extends AbstractChoiceListTest $this->assertSame(array(0 => 'a', 1 => 'b', 2 => 'c', 3 => 'd'), $this->list->getValues()); $this->assertEquals(array( 'Group 1' => array(1 => new ChoiceView('b', 'b', 'B')), - 'Group 2' => array(2 => new ChoiceView('c', 'c', 'C')) + 'Group 2' => array(2 => new ChoiceView('c', 'c', 'C')), ), $this->list->getPreferredViews()); $this->assertEquals(array( 'Group 1' => array(0 => new ChoiceView('a', 'a', 'A')), - 'Group 2' => array(3 => new ChoiceView('d', 'd', 'D')) + 'Group 2' => array(3 => new ChoiceView('d', 'd', 'D')), ), $this->list->getRemainingViews()); } diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToRfc3339TransformerTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToRfc3339TransformerTest.php index 16a7a4ad81..a39f53aa70 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToRfc3339TransformerTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/DateTimeToRfc3339TransformerTest.php @@ -65,7 +65,7 @@ class DateTimeToRfc3339TransformerTest extends DateTimeTestCase // format without seconds, as appears in some browsers array('UTC', 'UTC', '2010-02-03 04:05:00 UTC', '2010-02-03T04:05Z'), array('America/New_York', 'Asia/Hong_Kong', '2010-02-03 04:05:00 America/New_York', '2010-02-03T17:05+08:00'), - array('Europe/Amsterdam', 'Europe/Amsterdam', '2013-08-21 10:30:00 Europe/Amsterdam', '2013-08-21T08:30:00Z') + array('Europe/Amsterdam', 'Europe/Amsterdam', '2013-08-21 10:30:00 Europe/Amsterdam', '2013-08-21T08:30:00Z'), )); } diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/NumberToLocalizedStringTransformerTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/NumberToLocalizedStringTransformerTest.php index 971dd0a738..88115eaaae 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/NumberToLocalizedStringTransformerTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/NumberToLocalizedStringTransformerTest.php @@ -89,7 +89,6 @@ class NumberToLocalizedStringTransformerTest extends \PHPUnit_Framework_TestCase $transformer = new NumberToLocalizedStringTransformer(2, null, NumberToLocalizedStringTransformer::ROUND_DOWN); $this->assertEquals('1234,54', $transformer->transform(1234.547), '->transform() rounding-mode works'); - } /** diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/ValueToDuplicatesTransformerTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/ValueToDuplicatesTransformerTest.php index a8a088a95a..6dc9785c24 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/ValueToDuplicatesTransformerTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/ValueToDuplicatesTransformerTest.php @@ -93,13 +93,12 @@ class ValueToDuplicatesTransformerTest extends \PHPUnit_Framework_TestCase $this->assertNull($this->transformer->reverseTransform($input)); } - public function testReverseTransformZeroString() { $input = array( 'a' => '0', 'b' => '0', - 'c' => '0' + 'c' => '0', ); $this->assertSame('0', $this->transformer->reverseTransform($input)); diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/ChoiceTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/ChoiceTypeTest.php index b251da031c..0f100f24ea 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/ChoiceTypeTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/ChoiceTypeTest.php @@ -43,7 +43,7 @@ class ChoiceTypeTest extends \Symfony\Component\Form\Test\TypeTestCase 'Doctrine' => array( 'd' => 'Jon', 'e' => 'Roman', - ) + ), ); protected function setUp() @@ -868,7 +868,7 @@ class ChoiceTypeTest extends \Symfony\Component\Form\Test\TypeTestCase '' => 'Empty', 1 => 'Not Empty', 2 => 'Not Empty 2', - ) + ), )); $form->submit(array('', '2')); diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/CurrencyTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/CurrencyTypeTest.php index b0eb6dc01c..ec290e3019 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/CurrencyTypeTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/CurrencyTypeTest.php @@ -33,5 +33,4 @@ class CurrencyTypeTest extends TypeTestCase $this->assertContains(new ChoiceView('USD', 'USD', 'US Dollar'), $choices, '', false, false); $this->assertContains(new ChoiceView('SIT', 'SIT', 'Slovenian Tolar'), $choices, '', false, false); } - } diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTimeTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTimeTypeTest.php index b9c1ebad38..213bc9ce43 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTimeTypeTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTimeTypeTest.php @@ -441,7 +441,7 @@ class DateTimeTypeTest extends TypeTestCase { $error = new FormError('Invalid!'); $form = $this->factory->create('datetime', null, array( - 'date_widget' => 'single_text' + 'date_widget' => 'single_text', )); $form['date']->addError($error); @@ -465,7 +465,7 @@ class DateTimeTypeTest extends TypeTestCase { $error = new FormError('Invalid!'); $form = $this->factory->create('datetime', null, array( - 'time_widget' => 'single_text' + 'time_widget' => 'single_text', )); $form['time']->addError($error); @@ -473,5 +473,4 @@ class DateTimeTypeTest extends TypeTestCase $this->assertSame(array(), $form['time']->getErrors()); $this->assertSame(array($error), $form->getErrors()); } - } diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTypeTest.php index 508ab410b0..f095f30354 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTypeTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/DateTypeTest.php @@ -412,7 +412,7 @@ class DateTypeTest extends TypeTestCase $this->assertEquals(array( new ChoiceView('1', '1', 'Jän'), - new ChoiceView('4', '4', 'Apr.') + new ChoiceView('4', '4', 'Apr.'), ), $view['month']->vars['choices']); } @@ -554,7 +554,7 @@ class DateTypeTest extends TypeTestCase public function testPassDatePatternToViewDifferentPattern() { $form = $this->factory->create('date', null, array( - 'format' => 'MMyyyydd' + 'format' => 'MMyyyydd', )); $view = $form->createView(); @@ -565,7 +565,7 @@ class DateTypeTest extends TypeTestCase public function testPassDatePatternToViewDifferentPatternWithSeparators() { $form = $this->factory->create('date', null, array( - 'format' => 'MM*yyyy*dd' + 'format' => 'MM*yyyy*dd', )); $view = $form->createView(); diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/FormTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/FormTypeTest.php index e670e57389..35cc17c6aa 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/FormTypeTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/FormTypeTest.php @@ -334,7 +334,7 @@ class FormTypeTest extends BaseTypeTest // reference has a getter, but not setter 'reference' => array( 'firstName' => 'Foo', - ) + ), )); $this->assertEquals('Foo', $author->getReference()->firstName); @@ -359,7 +359,7 @@ class FormTypeTest extends BaseTypeTest // referenceCopy has a getter that returns a copy 'referenceCopy' => array( 'firstName' => 'Foo', - ) + ), )); $this->assertEquals('Foo', $author->getReferenceCopy()->firstName); @@ -372,7 +372,7 @@ class FormTypeTest extends BaseTypeTest $builder = $this->factory->createBuilder('form', $author); $builder->add('referenceCopy', 'form', array( 'data_class' => 'Symfony\Component\Form\Tests\Fixtures\Author', - 'by_reference' => false + 'by_reference' => false, )); $builder->get('referenceCopy')->add('firstName', 'text'); $form = $builder->getForm(); @@ -381,7 +381,7 @@ class FormTypeTest extends BaseTypeTest // referenceCopy has a getter that returns a copy 'referenceCopy' => array( 'firstName' => 'Foo', - ) + ), )); // firstName can only be updated if setReferenceCopy() was called @@ -576,7 +576,7 @@ class FormTypeTest extends BaseTypeTest public function testPassZeroLabelToView() { $view = $this->factory->create('form', null, array( - 'label' => '0' + 'label' => '0', )) ->createView(); diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/RepeatedTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/RepeatedTypeTest.php index 9e125d781b..d506f5f5a6 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/RepeatedTypeTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/RepeatedTypeTest.php @@ -52,7 +52,7 @@ class RepeatedTypeTest extends \Symfony\Component\Form\Test\TypeTestCase // the global required value cannot be overridden 'type' => 'text', 'first_options' => array('label' => 'Test', 'required' => false), - 'second_options' => array('label' => 'Test2') + 'second_options' => array('label' => 'Test2'), )); $this->assertEquals('Test', $form['first']->getConfig()->getOption('label')); @@ -112,7 +112,7 @@ class RepeatedTypeTest extends \Symfony\Component\Form\Test\TypeTestCase $form = $this->factory->create('repeated', null, array( 'type' => 'text', 'options' => array('label' => 'Label'), - 'second_options' => array('label' => 'Second label') + 'second_options' => array('label' => 'Second label'), )); $this->assertEquals('Label', $form['first']->getConfig()->getOption('label')); diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/TimeTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/TimeTypeTest.php index ca186207ac..b4fb3b1572 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/TimeTypeTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/TimeTypeTest.php @@ -276,7 +276,7 @@ class TimeTypeTest extends TypeTestCase $displayedData = array( 'hour' => (int) $outputTime->format('H'), 'minute' => (int) $outputTime->format('i'), - 'second' => (int) $outputTime->format('s') + 'second' => (int) $outputTime->format('s'), ); $this->assertEquals($displayedData, $form->getViewData()); @@ -302,7 +302,7 @@ class TimeTypeTest extends TypeTestCase $displayedData = array( 'hour' => (int) $outputTime->format('H'), 'minute' => (int) $outputTime->format('i'), - 'second' => (int) $outputTime->format('s') + 'second' => (int) $outputTime->format('s'), ); $this->assertDateTimeEquals($dateTime, $form->getData()); @@ -510,8 +510,8 @@ class TimeTypeTest extends TypeTestCase 'widget' => 'single_text', 'with_seconds' => true, 'attr' => array( - 'step' => 30 - ) + 'step' => 30, + ), )); $view = $form->createView(); diff --git a/src/Symfony/Component/Form/Tests/Extension/HttpFoundation/EventListener/BindRequestListenerTest.php b/src/Symfony/Component/Form/Tests/Extension/HttpFoundation/EventListener/BindRequestListenerTest.php index 2ff072b2eb..00a93aa264 100644 --- a/src/Symfony/Component/Form/Tests/Extension/HttpFoundation/EventListener/BindRequestListenerTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/HttpFoundation/EventListener/BindRequestListenerTest.php @@ -51,7 +51,7 @@ class BindRequestListenerTest extends \PHPUnit_Framework_TestCase 'name' => 'upload.png', 'size' => 123, 'tmp_name' => $path, - 'type' => 'image/png' + 'type' => 'image/png', ), ); diff --git a/src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorTest.php b/src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorTest.php index bfb84a15f8..19d5cec9f4 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorTest.php @@ -221,7 +221,7 @@ class FormValidatorTest extends AbstractConstraintValidatorTest $this->assertViolation('invalid_message_key', array( '{{ value }}' => 'foo', - '{{ foo }}' => 'bar' + '{{ foo }}' => 'bar', ), 'property.path', 'foo', null, Form::ERR_INVALID); } @@ -253,7 +253,7 @@ class FormValidatorTest extends AbstractConstraintValidatorTest $this->assertViolation('invalid_message_key', array( '{{ value }}' => 'foo', - '{{ foo }}' => 'bar' + '{{ foo }}' => 'bar', ), 'property.path', 'foo', null, Form::ERR_INVALID); } @@ -355,7 +355,7 @@ class FormValidatorTest extends AbstractConstraintValidatorTest $object = $this->getMock('\stdClass'); $options = array('validation_groups' => function (FormInterface $form) { return array('group1', 'group2'); - }); + },); $form = $this->getBuilder('name', '\stdClass', $options) ->setData($object) ->getForm(); @@ -538,7 +538,7 @@ class FormValidatorTest extends AbstractConstraintValidatorTest $this->validator->validate($form, new Form()); $this->assertViolation('Extra!', array( - '{{ extra_fields }}' => 'foo' + '{{ extra_fields }}' => 'foo', ), 'property.path', array('foo' => 'bar')); } diff --git a/src/Symfony/Component/Form/Tests/Extension/Validator/ValidatorTypeGuesserTest.php b/src/Symfony/Component/Form/Tests/Extension/Validator/ValidatorTypeGuesserTest.php index f42003d214..090abf4486 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Validator/ValidatorTypeGuesserTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Validator/ValidatorTypeGuesserTest.php @@ -71,7 +71,7 @@ class ValidatorTypeGuesserTest extends \PHPUnit_Framework_TestCase array('double'), array('float'), array('numeric'), - array('real') + array('real'), ); } } diff --git a/src/Symfony/Component/Form/Tests/Guess/GuessTest.php b/src/Symfony/Component/Form/Tests/Guess/GuessTest.php index 235eb6ed2d..2422663720 100644 --- a/src/Symfony/Component/Form/Tests/Guess/GuessTest.php +++ b/src/Symfony/Component/Form/Tests/Guess/GuessTest.php @@ -13,7 +13,9 @@ namespace Symfony\Component\Form\Tests\Guess; use Symfony\Component\Form\Guess\Guess; -class TestGuess extends Guess {} +class TestGuess extends Guess +{ +} class GuessTest extends \PHPUnit_Framework_TestCase { diff --git a/src/Symfony/Component/Form/Tests/NativeRequestHandlerTest.php b/src/Symfony/Component/Form/Tests/NativeRequestHandlerTest.php index 9d3a997fec..02b0a4ed74 100644 --- a/src/Symfony/Component/Form/Tests/NativeRequestHandlerTest.php +++ b/src/Symfony/Component/Form/Tests/NativeRequestHandlerTest.php @@ -82,7 +82,7 @@ class NativeRequestHandlerTest extends AbstractRequestHandlerTest 'type' => '', 'tmp_name' => '', 'error' => UPLOAD_ERR_NO_FILE, - 'size' => 0 + 'size' => 0, ))); $form->expects($this->once()) diff --git a/src/Symfony/Component/Form/Tests/SimpleFormTest.php b/src/Symfony/Component/Form/Tests/SimpleFormTest.php index d6d3238b42..657f145c6c 100644 --- a/src/Symfony/Component/Form/Tests/SimpleFormTest.php +++ b/src/Symfony/Component/Form/Tests/SimpleFormTest.php @@ -518,7 +518,7 @@ class SimpleFormTest extends AbstractFormTest '' => '', // direction is reversed! 'norm' => 'filteredclient', - 'filterednorm' => 'cleanedclient' + 'filterednorm' => 'cleanedclient', ))) ->addModelTransformer(new FixedDataTransformer(array( '' => '', diff --git a/src/Symfony/Component/Form/Util/FormUtil.php b/src/Symfony/Component/Form/Util/FormUtil.php index b3beb458be..af6ac4a643 100644 --- a/src/Symfony/Component/Form/Util/FormUtil.php +++ b/src/Symfony/Component/Form/Util/FormUtil.php @@ -19,7 +19,9 @@ class FormUtil /** * This class should not be instantiated */ - private function __construct() {} + private function __construct() + { + } /** * Returns whether the given data is empty. diff --git a/src/Symfony/Component/Form/Util/OrderedHashMap.php b/src/Symfony/Component/Form/Util/OrderedHashMap.php index bf5b08cda6..2ba53e2610 100644 --- a/src/Symfony/Component/Form/Util/OrderedHashMap.php +++ b/src/Symfony/Component/Form/Util/OrderedHashMap.php @@ -120,7 +120,7 @@ class OrderedHashMap implements \ArrayAccess, \IteratorAggregate, \Countable public function offsetGet($key) { if (!isset($this->elements[$key])) { - throw new \OutOfBoundsException('The offset "' . $key . '" does not exist.'); + throw new \OutOfBoundsException('The offset "'.$key.'" does not exist.'); } return $this->elements[$key]; diff --git a/src/Symfony/Component/HttpFoundation/File/UploadedFile.php b/src/Symfony/Component/HttpFoundation/File/UploadedFile.php index 4133d2eabc..d729546875 100644 --- a/src/Symfony/Component/HttpFoundation/File/UploadedFile.php +++ b/src/Symfony/Component/HttpFoundation/File/UploadedFile.php @@ -305,6 +305,6 @@ class UploadedFile extends File $maxFilesize = $errorCode === UPLOAD_ERR_INI_SIZE ? self::getMaxFilesize() / 1024 : 0; $message = isset($errors[$errorCode]) ? $errors[$errorCode] : 'The file "%s" was not uploaded due to an unknown error.'; - return sprintf($message, $this->getClientOriginalName(), $maxFilesize); + return sprintf($message, $this->getClientOriginalName(), $maxFilesize); } } diff --git a/src/Symfony/Component/HttpFoundation/FileBag.php b/src/Symfony/Component/HttpFoundation/FileBag.php index 12bc5fe3c0..699e408d02 100644 --- a/src/Symfony/Component/HttpFoundation/FileBag.php +++ b/src/Symfony/Component/HttpFoundation/FileBag.php @@ -146,7 +146,7 @@ class FileBag extends ParameterBag 'name' => $data['name'][$key], 'type' => $data['type'][$key], 'tmp_name' => $data['tmp_name'][$key], - 'size' => $data['size'][$key] + 'size' => $data['size'][$key], )); } diff --git a/src/Symfony/Component/HttpFoundation/IpUtils.php b/src/Symfony/Component/HttpFoundation/IpUtils.php index 815c266400..892503e98f 100644 --- a/src/Symfony/Component/HttpFoundation/IpUtils.php +++ b/src/Symfony/Component/HttpFoundation/IpUtils.php @@ -21,7 +21,9 @@ class IpUtils /** * This class should not be instantiated */ - private function __construct() {} + private function __construct() + { + } /** * Checks if an IPv4 or IPv6 address is contained in the list of given IPs or subnets @@ -37,7 +39,7 @@ class IpUtils $ips = array($ips); } - $method = false !== strpos($requestIp, ':') ? 'checkIp6': 'checkIp4'; + $method = false !== strpos($requestIp, ':') ? 'checkIp6' : 'checkIp4'; foreach ($ips as $ip) { if (self::$method($requestIp, $ip)) { diff --git a/src/Symfony/Component/HttpFoundation/ParameterBag.php b/src/Symfony/Component/HttpFoundation/ParameterBag.php index ebb17bb66e..8791275baf 100644 --- a/src/Symfony/Component/HttpFoundation/ParameterBag.php +++ b/src/Symfony/Component/HttpFoundation/ParameterBag.php @@ -266,7 +266,7 @@ class ParameterBag implements \IteratorAggregate, \Countable * * @return mixed */ - public function filter($key, $default = null, $deep = false, $filter=FILTER_DEFAULT, $options=array()) + public function filter($key, $default = null, $deep = false, $filter = FILTER_DEFAULT, $options = array()) { $value = $this->get($key, $default, $deep); diff --git a/src/Symfony/Component/HttpFoundation/Request.php b/src/Symfony/Component/HttpFoundation/Request.php index c6a784e1d0..9fd02cc2d1 100644 --- a/src/Symfony/Component/HttpFoundation/Request.php +++ b/src/Symfony/Component/HttpFoundation/Request.php @@ -982,7 +982,7 @@ class Request $pass = $this->getPassword(); if ('' != $pass) { - $userinfo .= ":$pass"; + $userinfo .= ":$pass"; } return $userinfo; diff --git a/src/Symfony/Component/HttpFoundation/Response.php b/src/Symfony/Component/HttpFoundation/Response.php index cfff05ff97..44d87d3007 100644 --- a/src/Symfony/Component/HttpFoundation/Response.php +++ b/src/Symfony/Component/HttpFoundation/Response.php @@ -223,10 +223,10 @@ class Response // Fix Content-Type $charset = $this->charset ?: 'UTF-8'; if (!$headers->has('Content-Type')) { - $headers->set('Content-Type', 'text/html; charset=' . $charset); + $headers->set('Content-Type', 'text/html; charset='.$charset); } elseif (0 === stripos($headers->get('Content-Type'), 'text/') && false === stripos($headers->get('Content-Type'), 'charset')) { // add the charset - $headers->set('Content-Type', $headers->get('Content-Type') . '; charset=' . $charset); + $headers->set('Content-Type', $headers->get('Content-Type').'; charset='.$charset); } // Fix Content-Length diff --git a/src/Symfony/Component/HttpFoundation/Session/Flash/FlashBag.php b/src/Symfony/Component/HttpFoundation/Session/Flash/FlashBag.php index d62e3835ab..7d7e307f9e 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Flash/FlashBag.php +++ b/src/Symfony/Component/HttpFoundation/Session/Flash/FlashBag.php @@ -76,7 +76,7 @@ class FlashBag implements FlashBagInterface, \IteratorAggregate /** * {@inheritdoc} */ - public function peek($type, array $default =array()) + public function peek($type, array $default = array()) { return $this->has($type) ? $this->flashes[$type] : $default; } diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php index 87aa7fb4f7..ca7920cfdb 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MongoDbSessionHandler.php @@ -90,7 +90,7 @@ class MongoDbSessionHandler implements \SessionHandlerInterface public function destroy($sessionId) { $this->getCollection()->remove(array( - $this->options['id_field'] => $sessionId + $this->options['id_field'] => $sessionId, )); return true; diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeSessionHandler.php index 1260ad0d29..22acdecf61 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeSessionHandler.php @@ -18,7 +18,11 @@ namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; */ if (version_compare(phpversion(), '5.4.0', '>=')) { - class NativeSessionHandler extends \SessionHandler {} + class NativeSessionHandler extends \SessionHandler + { + } } else { - class NativeSessionHandler {} + class NativeSessionHandler + { + } } diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php index 221c7aecaa..569e08958b 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php @@ -235,18 +235,18 @@ class PdoSessionHandler implements \SessionHandlerInterface switch ($driver) { case 'mysql': - return "INSERT INTO $this->table ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time) " . + return "INSERT INTO $this->table ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time) ". "ON DUPLICATE KEY UPDATE $this->dataCol = VALUES($this->dataCol), $this->timeCol = VALUES($this->timeCol)"; case 'oci': // DUAL is Oracle specific dummy table - return "MERGE INTO $this->table USING DUAL ON ($this->idCol = :id) " . - "WHEN NOT MATCHED THEN INSERT ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time) " . + return "MERGE INTO $this->table USING DUAL ON ($this->idCol = :id) ". + "WHEN NOT MATCHED THEN INSERT ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time) ". "WHEN MATCHED THEN UPDATE SET $this->dataCol = :data, $this->timeCol = :time"; case 'sqlsrv' === $driver && version_compare($this->pdo->getAttribute(\PDO::ATTR_SERVER_VERSION), '10', '>='): // MERGE is only available since SQL Server 2008 and must be terminated by semicolon // It also requires HOLDLOCK according to http://weblogs.sqlteam.com/dang/archive/2009/01/31/UPSERT-Race-Condition-With-MERGE.aspx - return "MERGE INTO $this->table WITH (HOLDLOCK) USING (SELECT 1 AS dummy) AS src ON ($this->idCol = :id) " . - "WHEN NOT MATCHED THEN INSERT ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time) " . + return "MERGE INTO $this->table WITH (HOLDLOCK) USING (SELECT 1 AS dummy) AS src ON ($this->idCol = :id) ". + "WHEN NOT MATCHED THEN INSERT ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time) ". "WHEN MATCHED THEN UPDATE SET $this->dataCol = :data, $this->timeCol = :time;"; case 'sqlite': return "INSERT OR REPLACE INTO $this->table ($this->idCol, $this->dataCol, $this->timeCol) VALUES (:id, :data, :time)"; diff --git a/src/Symfony/Component/HttpFoundation/Tests/AcceptHeaderItemTest.php b/src/Symfony/Component/HttpFoundation/Tests/AcceptHeaderItemTest.php index 582fbdefe1..e4f354fc1f 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/AcceptHeaderItemTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/AcceptHeaderItemTest.php @@ -30,19 +30,19 @@ class AcceptHeaderItemTest extends \PHPUnit_Framework_TestCase return array( array( 'text/html', - 'text/html', array() + 'text/html', array(), ), array( '"this;should,not=matter"', - 'this;should,not=matter', array() + 'this;should,not=matter', array(), ), array( "text/plain; charset=utf-8;param=\"this;should,not=matter\";\tfootnotes=true", - 'text/plain', array('charset' => 'utf-8', 'param' => 'this;should,not=matter', 'footnotes' => 'true') + 'text/plain', array('charset' => 'utf-8', 'param' => 'this;should,not=matter', 'footnotes' => 'true'), ), array( '"this;should,not=matter";charset=utf-8', - 'this;should,not=matter', array('charset' => 'utf-8') + 'this;should,not=matter', array('charset' => 'utf-8'), ), ); } @@ -61,11 +61,11 @@ class AcceptHeaderItemTest extends \PHPUnit_Framework_TestCase return array( array( 'text/html', array(), - 'text/html' + 'text/html', ), array( 'text/plain', array('charset' => 'utf-8', 'param' => 'this;should,not=matter', 'footnotes' => 'true'), - 'text/plain;charset=utf-8;param="this;should,not=matter";footnotes=true' + 'text/plain;charset=utf-8;param="this;should,not=matter";footnotes=true', ), ); } diff --git a/src/Symfony/Component/HttpFoundation/Tests/ApacheRequestTest.php b/src/Symfony/Component/HttpFoundation/Tests/ApacheRequestTest.php index 965a7d2bf0..d9f9a32330 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/ApacheRequestTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/ApacheRequestTest.php @@ -39,7 +39,7 @@ class ApacheRequestTest extends \PHPUnit_Framework_TestCase ), '/foo/app_dev.php/bar', '/foo/app_dev.php', - '/bar' + '/bar', ), array( array( diff --git a/src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php b/src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php index 74344f76b7..cef037fd9b 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php @@ -20,7 +20,7 @@ class BinaryFileResponseTest extends ResponseTestCase { public function testConstruction() { - $file = __DIR__ . '/../README.md'; + $file = __DIR__.'/../README.md'; $response = new BinaryFileResponse($file, 404, array('X-Header' => 'Foo'), true, null, true, true); $this->assertEquals(404, $response->getStatusCode()); $this->assertEquals('Foo', $response->headers->get('X-Header')); @@ -152,7 +152,7 @@ class BinaryFileResponseTest extends ResponseTestCase { return array( array('bytes=-40'), - array('bytes=30-40') + array('bytes=30-40'), ); } @@ -162,7 +162,7 @@ class BinaryFileResponseTest extends ResponseTestCase $request->headers->set('X-Sendfile-Type', 'X-Sendfile'); BinaryFileResponse::trustXSendfileTypeHeader(); - $response = BinaryFileResponse::create(__DIR__ . '/../README.md'); + $response = BinaryFileResponse::create(__DIR__.'/../README.md'); $response->prepare($request); $this->expectOutputString(''); @@ -213,6 +213,6 @@ class BinaryFileResponseTest extends ResponseTestCase protected function provideResponse() { - return new BinaryFileResponse(__DIR__ . '/../README.md'); + return new BinaryFileResponse(__DIR__.'/../README.md'); } } diff --git a/src/Symfony/Component/HttpFoundation/Tests/FileBagTest.php b/src/Symfony/Component/HttpFoundation/Tests/FileBagTest.php index 1f29d56bc0..738604bcc7 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/FileBagTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/FileBagTest.php @@ -40,7 +40,7 @@ class FileBagTest extends \PHPUnit_Framework_TestCase 'type' => 'text/plain', 'tmp_name' => $tmpFile, 'error' => 0, - 'size' => 100 + 'size' => 100, ))); $this->assertEquals($file, $bag->get('file')); @@ -53,7 +53,7 @@ class FileBagTest extends \PHPUnit_Framework_TestCase 'type' => '', 'tmp_name' => '', 'error' => UPLOAD_ERR_NO_FILE, - 'size' => 0 + 'size' => 0, ))); $this->assertNull($bag->get('file')); @@ -81,7 +81,7 @@ class FileBagTest extends \PHPUnit_Framework_TestCase 'size' => array( 'file' => 100, ), - ) + ), )); $files = $bag->all(); @@ -96,21 +96,21 @@ class FileBagTest extends \PHPUnit_Framework_TestCase $bag = new FileBag(array( 'child' => array( 'name' => array( - 'sub' => array('file' => basename($tmpFile)) + 'sub' => array('file' => basename($tmpFile)), ), 'type' => array( - 'sub' => array('file' => 'text/plain') + 'sub' => array('file' => 'text/plain'), ), 'tmp_name' => array( - 'sub' => array('file' => $tmpFile) + 'sub' => array('file' => $tmpFile), ), 'error' => array( - 'sub' => array('file' => 0) + 'sub' => array('file' => 0), ), 'size' => array( - 'sub' => array('file' => 100) + 'sub' => array('file' => 100), ), - ) + ), )); $files = $bag->all(); diff --git a/src/Symfony/Component/HttpFoundation/Tests/ParameterBagTest.php b/src/Symfony/Component/HttpFoundation/Tests/ParameterBagTest.php index 7f4f243b48..95af8a14d9 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/ParameterBagTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/ParameterBagTest.php @@ -212,16 +212,15 @@ class ParameterBagTest extends \PHPUnit_Framework_TestCase $this->assertFalse($bag->filter('dec', '', false, FILTER_VALIDATE_INT, array( 'flags' => FILTER_FLAG_ALLOW_HEX, - 'options' => array('min_range' => 1, 'max_range' => 0xff)) + 'options' => array('min_range' => 1, 'max_range' => 0xff),) ), '->filter() gets a value of parameter as integer between boundaries'); $this->assertFalse($bag->filter('hex', '', false, FILTER_VALIDATE_INT, array( 'flags' => FILTER_FLAG_ALLOW_HEX, - 'options' => array('min_range' => 1, 'max_range' => 0xff)) + 'options' => array('min_range' => 1, 'max_range' => 0xff),) ), '->filter() gets a value of parameter as integer between boundaries'); $this->assertEquals(array('bang'), $bag->filter('array', '', false), '->filter() gets a value of parameter as an array'); - } /** diff --git a/src/Symfony/Component/HttpFoundation/Tests/RequestMatcherTest.php b/src/Symfony/Component/HttpFoundation/Tests/RequestMatcherTest.php index 0e1a0f5caf..63d37492ec 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/RequestMatcherTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/RequestMatcherTest.php @@ -54,7 +54,7 @@ class RequestMatcherTest extends \PHPUnit_Framework_TestCase $matcher->matchHost($pattern); $this->assertSame($isMatch, $matcher->matches($request)); - $matcher= new RequestMatcher(null, $pattern); + $matcher = new RequestMatcher(null, $pattern); $this->assertSame($isMatch, $matcher->matches($request)); } diff --git a/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php b/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php index 9907d122d8..6059969363 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/RequestTest.php @@ -696,7 +696,7 @@ class RequestTest extends \PHPUnit_Framework_TestCase { $request = Request::create('http://example.com', 'GET', array(), array(), array(), array( 'HTTP_X_FORWARDED_PROTO' => 'https', - 'HTTP_X_FORWARDED_PORT' => '443' + 'HTTP_X_FORWARDED_PORT' => '443', )); $port = $request->getPort(); @@ -705,40 +705,40 @@ class RequestTest extends \PHPUnit_Framework_TestCase Request::setTrustedProxies(array('1.1.1.1')); $request = Request::create('http://example.com', 'GET', array(), array(), array(), array( 'HTTP_X_FORWARDED_PROTO' => 'https', - 'HTTP_X_FORWARDED_PORT' => '8443' + 'HTTP_X_FORWARDED_PORT' => '8443', )); $port = $request->getPort(); $this->assertEquals(8443, $port, 'With PROTO and PORT set PORT takes precedence.'); $request = Request::create('http://example.com', 'GET', array(), array(), array(), array( - 'HTTP_X_FORWARDED_PROTO' => 'https' + 'HTTP_X_FORWARDED_PROTO' => 'https', )); $port = $request->getPort(); $this->assertEquals(443, $port, 'With only PROTO set getPort() defaults to 443.'); $request = Request::create('http://example.com', 'GET', array(), array(), array(), array( - 'HTTP_X_FORWARDED_PROTO' => 'http' + 'HTTP_X_FORWARDED_PROTO' => 'http', )); $port = $request->getPort(); $this->assertEquals(80, $port, 'If X_FORWARDED_PROTO is set to HTTP return 80.'); $request = Request::create('http://example.com', 'GET', array(), array(), array(), array( - 'HTTP_X_FORWARDED_PROTO' => 'On' + 'HTTP_X_FORWARDED_PROTO' => 'On', )); $port = $request->getPort(); $this->assertEquals(443, $port, 'With only PROTO set and value is On, getPort() defaults to 443.'); $request = Request::create('http://example.com', 'GET', array(), array(), array(), array( - 'HTTP_X_FORWARDED_PROTO' => '1' + 'HTTP_X_FORWARDED_PROTO' => '1', )); $port = $request->getPort(); $this->assertEquals(443, $port, 'With only PROTO set and value is 1, getPort() defaults to 443.'); $request = Request::create('http://example.com', 'GET', array(), array(), array(), array( - 'HTTP_X_FORWARDED_PROTO' => 'something-else' + 'HTTP_X_FORWARDED_PROTO' => 'something-else', )); $port = $request->getPort(); $this->assertEquals(80, $port, 'With only PROTO set and value is not recognized, getPort() defaults to 80.'); @@ -1496,31 +1496,31 @@ class RequestTest extends \PHPUnit_Framework_TestCase 'X_ORIGINAL_URL' => '/foo/bar', ), array(), - '/foo/bar' + '/foo/bar', ), array( array( 'X_REWRITE_URL' => '/foo/bar', ), array(), - '/foo/bar' + '/foo/bar', ), array( array(), array( 'IIS_WasUrlRewritten' => '1', - 'UNENCODED_URL' => '/foo/bar' + 'UNENCODED_URL' => '/foo/bar', ), - '/foo/bar' + '/foo/bar', ), array( array( 'X_ORIGINAL_URL' => '/foo/bar', ), array( - 'HTTP_X_ORIGINAL_URL' => '/foo/bar' + 'HTTP_X_ORIGINAL_URL' => '/foo/bar', ), - '/foo/bar' + '/foo/bar', ), array( array( @@ -1528,9 +1528,9 @@ class RequestTest extends \PHPUnit_Framework_TestCase ), array( 'IIS_WasUrlRewritten' => '1', - 'UNENCODED_URL' => '/foo/bar' + 'UNENCODED_URL' => '/foo/bar', ), - '/foo/bar' + '/foo/bar', ), array( array( @@ -1539,16 +1539,16 @@ class RequestTest extends \PHPUnit_Framework_TestCase array( 'HTTP_X_ORIGINAL_URL' => '/foo/bar', 'IIS_WasUrlRewritten' => '1', - 'UNENCODED_URL' => '/foo/bar' + 'UNENCODED_URL' => '/foo/bar', ), - '/foo/bar' + '/foo/bar', ), array( array(), array( 'ORIG_PATH_INFO' => '/foo/bar', ), - '/foo/bar' + '/foo/bar', ), array( array(), @@ -1556,8 +1556,8 @@ class RequestTest extends \PHPUnit_Framework_TestCase 'ORIG_PATH_INFO' => '/foo/bar', 'QUERY_STRING' => 'foo=bar', ), - '/foo/bar?foo=bar' - ) + '/foo/bar?foo=bar', + ), ); } diff --git a/src/Symfony/Component/HttpFoundation/Tests/ResponseHeaderBagTest.php b/src/Symfony/Component/HttpFoundation/Tests/ResponseHeaderBagTest.php index 1cb327860d..1201deb903 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/ResponseHeaderBagTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/ResponseHeaderBagTest.php @@ -32,31 +32,31 @@ class ResponseHeaderBagTest extends \PHPUnit_Framework_TestCase return array( array( array('fOo' => 'BAR'), - array('fOo' => array('BAR'), 'Cache-Control' => array('no-cache')) + array('fOo' => array('BAR'), 'Cache-Control' => array('no-cache')), ), array( array('ETag' => 'xyzzy'), - array('ETag' => array('xyzzy'), 'Cache-Control' => array('private, must-revalidate')) + array('ETag' => array('xyzzy'), 'Cache-Control' => array('private, must-revalidate')), ), array( array('Content-MD5' => 'Q2hlY2sgSW50ZWdyaXR5IQ=='), - array('Content-MD5' => array('Q2hlY2sgSW50ZWdyaXR5IQ=='), 'Cache-Control' => array('no-cache')) + array('Content-MD5' => array('Q2hlY2sgSW50ZWdyaXR5IQ=='), 'Cache-Control' => array('no-cache')), ), array( array('P3P' => 'CP="CAO PSA OUR"'), - array('P3P' => array('CP="CAO PSA OUR"'), 'Cache-Control' => array('no-cache')) + array('P3P' => array('CP="CAO PSA OUR"'), 'Cache-Control' => array('no-cache')), ), array( array('WWW-Authenticate' => 'Basic realm="WallyWorld"'), - array('WWW-Authenticate' => array('Basic realm="WallyWorld"'), 'Cache-Control' => array('no-cache')) + array('WWW-Authenticate' => array('Basic realm="WallyWorld"'), 'Cache-Control' => array('no-cache')), ), array( array('X-UA-Compatible' => 'IE=edge,chrome=1'), - array('X-UA-Compatible' => array('IE=edge,chrome=1'), 'Cache-Control' => array('no-cache')) + array('X-UA-Compatible' => array('IE=edge,chrome=1'), 'Cache-Control' => array('no-cache')), ), array( array('X-XSS-Protection' => '1; mode=block'), - array('X-XSS-Protection' => array('1; mode=block'), 'Cache-Control' => array('no-cache')) + array('X-XSS-Protection' => array('1; mode=block'), 'Cache-Control' => array('no-cache')), ), ); } @@ -82,7 +82,7 @@ class ResponseHeaderBagTest extends \PHPUnit_Framework_TestCase $bag = new ResponseHeaderBag(array( 'Expires' => 'Wed, 16 Feb 2011 14:17:43 GMT', - 'Cache-Control' => 'max-age=3600' + 'Cache-Control' => 'max-age=3600', )); $this->assertEquals('max-age=3600, private', $bag->get('Cache-Control')); diff --git a/src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php b/src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php index f16cb4930a..b76179aae0 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/ResponseTest.php @@ -532,7 +532,7 @@ class ResponseTest extends ResponseTestCase array('200', 'foo', 'foo'), array('199', null, ''), array('199', false, ''), - array('199', 'foo', 'foo') + array('199', 'foo', 'foo'), ); } diff --git a/src/Symfony/Component/HttpFoundation/Tests/ServerBagTest.php b/src/Symfony/Component/HttpFoundation/Tests/ServerBagTest.php index 662c5880b1..4cded7fa03 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/ServerBagTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/ServerBagTest.php @@ -52,7 +52,7 @@ class ServerBagTest extends \PHPUnit_Framework_TestCase $this->assertEquals(array( 'AUTHORIZATION' => 'Basic '.base64_encode('foo:'), 'PHP_AUTH_USER' => 'foo', - 'PHP_AUTH_PW' => '' + 'PHP_AUTH_PW' => '', ), $bag->getHeaders()); } @@ -63,7 +63,7 @@ class ServerBagTest extends \PHPUnit_Framework_TestCase $this->assertEquals(array( 'AUTHORIZATION' => 'Basic '.base64_encode('foo:bar'), 'PHP_AUTH_USER' => 'foo', - 'PHP_AUTH_PW' => 'bar' + 'PHP_AUTH_PW' => 'bar', ), $bag->getHeaders()); } @@ -84,7 +84,7 @@ class ServerBagTest extends \PHPUnit_Framework_TestCase $this->assertEquals(array( 'AUTHORIZATION' => 'Basic '.base64_encode('username:pass:word'), 'PHP_AUTH_USER' => 'username', - 'PHP_AUTH_PW' => 'pass:word' + 'PHP_AUTH_PW' => 'pass:word', ), $bag->getHeaders()); } @@ -95,7 +95,7 @@ class ServerBagTest extends \PHPUnit_Framework_TestCase $this->assertEquals(array( 'AUTHORIZATION' => 'Basic '.base64_encode('foo:'), 'PHP_AUTH_USER' => 'foo', - 'PHP_AUTH_PW' => '' + 'PHP_AUTH_PW' => '', ), $bag->getHeaders()); } diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Attribute/AttributeBagTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Attribute/AttributeBagTest.php index 93c634cde0..2d1d77c330 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Attribute/AttributeBagTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Attribute/AttributeBagTest.php @@ -43,7 +43,7 @@ class AttributeBagTest extends \PHPUnit_Framework_TestCase 'category' => array( 'fishing' => array( 'first' => 'cod', - 'second' => 'sole') + 'second' => 'sole',), ), ); $this->bag = new AttributeBag('_sf2'); diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Attribute/NamespacedAttributeBagTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Attribute/NamespacedAttributeBagTest.php index 0c46a515a0..70910680ba 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Attribute/NamespacedAttributeBagTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Attribute/NamespacedAttributeBagTest.php @@ -43,7 +43,7 @@ class NamespacedAttributeBagTest extends \PHPUnit_Framework_TestCase 'category' => array( 'fishing' => array( 'first' => 'cod', - 'second' => 'sole') + 'second' => 'sole',), ), ); $this->bag = new NamespacedAttributeBag('_sf2', '/'); diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Flash/FlashBagTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Flash/FlashBagTest.php index acfed71aed..d6e27bb30d 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Flash/FlashBagTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Flash/FlashBagTest.php @@ -91,7 +91,7 @@ class FlashBagTest extends \PHPUnit_Framework_TestCase $this->bag->set('error', 'Bar'); $this->assertEquals(array( 'notice' => array('Foo'), - 'error' => array('Bar')), $this->bag->all() + 'error' => array('Bar'),), $this->bag->all() ); $this->assertEquals(array(), $this->bag->all()); diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php index 9577d52478..927766440b 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php @@ -41,7 +41,7 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase 'data_field' => 'data', 'time_field' => 'time', 'database' => 'sf2-test', - 'collection' => 'session-test' + 'collection' => 'session-test', ); $this->storage = new MongoDbSessionHandler($this->mongo, $this->options); @@ -162,7 +162,6 @@ class MongoDbSessionHandlerTest extends \PHPUnit_Framework_TestCase private function createMongoCollectionMock() { - $mongoClient = $this->getMockBuilder('MongoClient') ->getMock(); $mongoDb = $this->getMockBuilder('MongoDB') diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/MetadataBagTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/MetadataBagTest.php index ef70281ce0..c2363bb31e 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/MetadataBagTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/MetadataBagTest.php @@ -74,7 +74,6 @@ class MetadataBagTest extends \PHPUnit_Framework_TestCase $this->assertEquals('__metadata', $this->bag->getName()); $this->bag->setName('foo'); $this->assertEquals('foo', $this->bag->getName()); - } public function testGetStorageKey() diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/AbstractProxyTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/AbstractProxyTest.php index 6b8bba0d5b..f8ac39c94c 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/AbstractProxyTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/AbstractProxyTest.php @@ -17,12 +17,11 @@ use Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy; // https://github.com/sebastianbergmann/phpunit-mock-objects/issues/73 class ConcreteProxy extends AbstractProxy { - } class ConcreteSessionHandlerInterfaceProxy extends AbstractProxy implements \SessionHandlerInterface { - public function open($savePath, $sessionName) + public function open($savePath, $sessionName) { } diff --git a/src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php index de9c6f0153..8a35ebc70f 100644 --- a/src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php +++ b/src/Symfony/Component/HttpKernel/DataCollector/ConfigDataCollector.php @@ -70,7 +70,7 @@ class ConfigDataCollector extends DataCollector 'wincache_enabled' => extension_loaded('wincache') && ini_get('wincache.ocenabled'), 'zend_opcache_enabled' => extension_loaded('Zend OPcache') && ini_get('opcache.enable'), 'bundles' => array(), - 'sapi_name' => php_sapi_name() + 'sapi_name' => php_sapi_name(), ); if (isset($this->kernel)) { diff --git a/src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php index f08720e807..e8d92745ca 100644 --- a/src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php +++ b/src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php @@ -41,7 +41,7 @@ class LoggerDataCollector extends DataCollector $this->data = array( 'error_count' => $this->logger->countErrors(), 'logs' => $this->sanitizeLogs($this->logger->getLogs()), - 'deprecation_count' => $this->computeDeprecationCount() + 'deprecation_count' => $this->computeDeprecationCount(), ); } } diff --git a/src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php b/src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php index 8af3ad7c4d..baf96c0d0d 100644 --- a/src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php +++ b/src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php @@ -277,7 +277,7 @@ class TraceableEventDispatcher implements EventDispatcherInterface, TraceableEve if ($listener instanceof \Closure) { $info += array( 'type' => 'Closure', - 'pretty' => 'closure' + 'pretty' => 'closure', ); } elseif (is_string($listener)) { try { @@ -406,7 +406,8 @@ class TraceableEventDispatcher implements EventDispatcherInterface, TraceableEve // which must be caught. try { $this->stopwatch->openSection($token); - } catch (\LogicException $e) {} + } catch (\LogicException $e) { + } break; } } @@ -432,7 +433,8 @@ class TraceableEventDispatcher implements EventDispatcherInterface, TraceableEve // does not exist, then closing it throws an exception which must be caught. try { $this->stopwatch->stopSection($token); - } catch (\LogicException $e) {} + } catch (\LogicException $e) { + } // The children profiles have been updated by the previous 'kernel.response' // event. Only the root profile need to be updated with the 'kernel.terminate' // timing information. diff --git a/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php b/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php index 871b3a87fc..e16ee6f311 100644 --- a/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php +++ b/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php @@ -152,7 +152,6 @@ class HttpCache implements HttpKernelInterface, TerminableInterface return $this->kernel; } - /** * Gets the Esi instance * diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 4e9594203b..5106940f7e 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -519,7 +519,6 @@ abstract class Kernel implements KernelInterface, TerminableInterface array_pop($bundleMap); } } - } /** diff --git a/src/Symfony/Component/HttpKernel/Profiler/BaseMemcacheProfilerStorage.php b/src/Symfony/Component/HttpKernel/Profiler/BaseMemcacheProfilerStorage.php index 39b517fac2..ba6f1952e4 100644 --- a/src/Symfony/Component/HttpKernel/Profiler/BaseMemcacheProfilerStorage.php +++ b/src/Symfony/Component/HttpKernel/Profiler/BaseMemcacheProfilerStorage.php @@ -53,12 +53,11 @@ abstract class BaseMemcacheProfilerStorage implements ProfilerStorageInterface $result = array(); foreach ($profileList as $item) { - if ($limit === 0) { break; } - if ($item=='') { + if ($item == '') { continue; } @@ -166,7 +165,6 @@ abstract class BaseMemcacheProfilerStorage implements ProfilerStorageInterface $profileIndexed = false !== $this->getValue($this->getItemName($profile->getToken())); if ($this->setValue($this->getItemName($profile->getToken()), $data, $this->lifetime)) { - if (!$profileIndexed) { // Add to index $indexName = $this->getIndexName(); @@ -304,5 +302,4 @@ abstract class BaseMemcacheProfilerStorage implements ProfilerStorageInterface return true; } - } diff --git a/src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php b/src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php index 9d08813f57..b7abad735c 100644 --- a/src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php +++ b/src/Symfony/Component/HttpKernel/Profiler/FileProfilerStorage.php @@ -70,7 +70,7 @@ class FileProfilerStorage implements ProfilerStorageInterface } if (!empty($start) && $csvTime < $start) { - continue; + continue; } if (!empty($end) && $csvTime > $end) { diff --git a/src/Symfony/Component/HttpKernel/Profiler/MemcacheProfilerStorage.php b/src/Symfony/Component/HttpKernel/Profiler/MemcacheProfilerStorage.php index ad70b97b9b..31f11ef086 100644 --- a/src/Symfony/Component/HttpKernel/Profiler/MemcacheProfilerStorage.php +++ b/src/Symfony/Component/HttpKernel/Profiler/MemcacheProfilerStorage.php @@ -91,7 +91,6 @@ class MemcacheProfilerStorage extends BaseMemcacheProfilerStorage $memcache = $this->getMemcache(); if (method_exists($memcache, 'append')) { - // Memcache v3.0 if (!$result = $memcache->append($key, $value, false, $expiration)) { return $memcache->set($key, $value, false, $expiration); diff --git a/src/Symfony/Component/HttpKernel/Profiler/MongoDbProfilerStorage.php b/src/Symfony/Component/HttpKernel/Profiler/MongoDbProfilerStorage.php index 9be3410dba..c5242806ee 100644 --- a/src/Symfony/Component/HttpKernel/Profiler/MongoDbProfilerStorage.php +++ b/src/Symfony/Component/HttpKernel/Profiler/MongoDbProfilerStorage.php @@ -82,7 +82,7 @@ class MongoDbProfilerStorage implements ProfilerStorageInterface 'ip' => $profile->getIp(), 'method' => $profile->getMethod(), 'url' => $profile->getUrl(), - 'time' => $profile->getTime() + 'time' => $profile->getTime(), ); $result = $this->getMongo()->update(array('_id' => $profile->getToken()), array_filter($record, function ($v) { return !empty($v); }), array('upsert' => true)); diff --git a/src/Symfony/Component/HttpKernel/Profiler/RedisProfilerStorage.php b/src/Symfony/Component/HttpKernel/Profiler/RedisProfilerStorage.php index 7ea4244500..d56e49dbae 100644 --- a/src/Symfony/Component/HttpKernel/Profiler/RedisProfilerStorage.php +++ b/src/Symfony/Component/HttpKernel/Profiler/RedisProfilerStorage.php @@ -171,7 +171,6 @@ class RedisProfilerStorage implements ProfilerStorageInterface $profileIndexed = false !== $this->getValue($this->getItemName($profile->getToken())); if ($this->setValue($this->getItemName($profile->getToken()), $data, $this->lifetime, self::REDIS_SERIALIZER_PHP)) { - if (!$profileIndexed) { // Add to index $indexName = $this->getIndexName(); diff --git a/src/Symfony/Component/HttpKernel/Tests/Bundle/BundleTest.php b/src/Symfony/Component/HttpKernel/Tests/Bundle/BundleTest.php index 8affb5f300..9871a2ca43 100644 --- a/src/Symfony/Component/HttpKernel/Tests/Bundle/BundleTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/Bundle/BundleTest.php @@ -43,6 +43,5 @@ class BundleTest extends \PHPUnit_Framework_TestCase $bundle2 = new ExtensionAbsentBundle(); $this->assertNull($bundle2->registerCommands($app)); - } } diff --git a/src/Symfony/Component/HttpKernel/Tests/ClientTest.php b/src/Symfony/Component/HttpKernel/Tests/ClientTest.php index 4d9918b504..a2b70a5ab8 100644 --- a/src/Symfony/Component/HttpKernel/Tests/ClientTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/ClientTest.php @@ -75,7 +75,7 @@ class ClientTest extends \PHPUnit_Framework_TestCase $expected = array( 'foo=bar; expires=Sun, 15 Feb 2009 20:00:00 GMT; domain=http://example.com; path=/foo; secure; httponly', - 'foo1=bar1; expires=Sun, 15 Feb 2009 20:00:00 GMT; domain=http://example.com; path=/foo; secure; httponly' + 'foo1=bar1; expires=Sun, 15 Feb 2009 20:00:00 GMT; domain=http://example.com; path=/foo; secure; httponly', ); $response = new Response(); diff --git a/src/Symfony/Component/HttpKernel/Tests/DataCollector/ExceptionDataCollectorTest.php b/src/Symfony/Component/HttpKernel/Tests/DataCollector/ExceptionDataCollectorTest.php index 54a8aabe67..c1e59f08a7 100644 --- a/src/Symfony/Component/HttpKernel/Tests/DataCollector/ExceptionDataCollectorTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/DataCollector/ExceptionDataCollectorTest.php @@ -43,5 +43,4 @@ class ExceptionDataCollectorTest extends \PHPUnit_Framework_TestCase $this->assertSame('exception',$c->getName()); $this->assertSame($trace,$c->getTrace()); } - } diff --git a/src/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php b/src/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php index ea82d9d315..1155326114 100644 --- a/src/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php @@ -50,28 +50,28 @@ class LoggerDataCollectorTest extends \PHPUnit_Framework_TestCase 1, array(array('message' => 'foo', 'context' => array())), null, - 0 + 0, ), array( 1, array(array('message' => 'foo', 'context' => array('foo' => fopen(__FILE__, 'r')))), array(array('message' => 'foo', 'context' => array('foo' => 'Resource(stream)'))), - 0 + 0, ), array( 1, array(array('message' => 'foo', 'context' => array('foo' => new \stdClass()))), array(array('message' => 'foo', 'context' => array('foo' => 'Object(stdClass)'))), - 0 + 0, ), array( 1, array( array('message' => 'foo', 'context' => array('type' => ErrorHandler::TYPE_DEPRECATION)), - array('message' => 'foo2', 'context' => array('type' => ErrorHandler::TYPE_DEPRECATION)) + array('message' => 'foo2', 'context' => array('type' => ErrorHandler::TYPE_DEPRECATION)), ), null, - 2 + 2, ), ); } diff --git a/src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php b/src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php index cd0251c1ee..5b0d7464ca 100644 --- a/src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php @@ -74,7 +74,7 @@ class RequestDataCollectorTest extends \PHPUnit_Framework_TestCase 'class' => 'Symfony\Component\HttpKernel\Tests\DataCollector\RequestDataCollectorTest', 'method' => 'testControllerInspection', 'file' => __FILE__, - 'line' => $r1->getStartLine() + 'line' => $r1->getStartLine(), ), ), @@ -102,7 +102,7 @@ class RequestDataCollectorTest extends \PHPUnit_Framework_TestCase 'class' => 'Symfony\Component\HttpKernel\Tests\DataCollector\RequestDataCollectorTest', 'method' => 'staticControllerMethod', 'file' => __FILE__, - 'line' => $r2->getStartLine() + 'line' => $r2->getStartLine(), ), ), @@ -113,7 +113,7 @@ class RequestDataCollectorTest extends \PHPUnit_Framework_TestCase 'class' => 'Symfony\Component\HttpKernel\Tests\DataCollector\RequestDataCollectorTest', 'method' => 'staticControllerMethod', 'file' => __FILE__, - 'line' => $r2->getStartLine() + 'line' => $r2->getStartLine(), ), ), @@ -124,7 +124,7 @@ class RequestDataCollectorTest extends \PHPUnit_Framework_TestCase 'class' => 'Symfony\Component\HttpKernel\Tests\DataCollector\RequestDataCollectorTest', 'method' => 'magicMethod', 'file' => 'n/a', - 'line' => 'n/a' + 'line' => 'n/a', ), ), @@ -135,7 +135,7 @@ class RequestDataCollectorTest extends \PHPUnit_Framework_TestCase 'class' => 'Symfony\Component\HttpKernel\Tests\DataCollector\RequestDataCollectorTest', 'method' => 'magicMethod', 'file' => 'n/a', - 'line' => 'n/a' + 'line' => 'n/a', ), ), ); @@ -166,7 +166,7 @@ class RequestDataCollectorTest extends \PHPUnit_Framework_TestCase $response->headers->setCookie(new Cookie('bazz','foo','2000-12-12')); return array( - array($request, $response) + array($request, $response), ); } @@ -204,5 +204,4 @@ class RequestDataCollectorTest extends \PHPUnit_Framework_TestCase { throw new \LogicException('Unexpected method call'); } - } diff --git a/src/Symfony/Component/HttpKernel/Tests/Debug/TraceableEventDispatcherTest.php b/src/Symfony/Component/HttpKernel/Tests/Debug/TraceableEventDispatcherTest.php index b9bc1d7f97..576f6a7180 100644 --- a/src/Symfony/Component/HttpKernel/Tests/Debug/TraceableEventDispatcherTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/Debug/TraceableEventDispatcherTest.php @@ -38,7 +38,7 @@ class TraceableEventDispatcherTest extends \PHPUnit_Framework_TestCase $dispatcher = new EventDispatcher(); $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch()); - $tdispatcher->addListener('foo', $listener = function () { ; }); + $tdispatcher->addListener('foo', $listener = function () {; }); $listeners = $dispatcher->getListeners('foo'); $this->assertCount(1, $listeners); $this->assertSame($listener, $listeners[0]); @@ -52,7 +52,7 @@ class TraceableEventDispatcherTest extends \PHPUnit_Framework_TestCase $dispatcher = new EventDispatcher(); $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch()); - $tdispatcher->addListener('foo', $listener = function () { ; }); + $tdispatcher->addListener('foo', $listener = function () {; }); $this->assertSame($dispatcher->getListeners('foo'), $tdispatcher->getListeners('foo')); } @@ -64,7 +64,7 @@ class TraceableEventDispatcherTest extends \PHPUnit_Framework_TestCase $this->assertFalse($dispatcher->hasListeners('foo')); $this->assertFalse($tdispatcher->hasListeners('foo')); - $tdispatcher->addListener('foo', $listener = function () { ; }); + $tdispatcher->addListener('foo', $listener = function () {; }); $this->assertTrue($dispatcher->hasListeners('foo')); $this->assertTrue($tdispatcher->hasListeners('foo')); } @@ -89,7 +89,7 @@ class TraceableEventDispatcherTest extends \PHPUnit_Framework_TestCase { $dispatcher = new EventDispatcher(); $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch()); - $tdispatcher->addListener('foo', $listener = function () { ; }); + $tdispatcher->addListener('foo', $listener = function () {; }); $this->assertEquals(array(), $tdispatcher->getCalledListeners()); $this->assertEquals(array('foo.closure' => array('event' => 'foo', 'type' => 'Closure', 'pretty' => 'closure')), $tdispatcher->getNotCalledListeners()); @@ -106,8 +106,8 @@ class TraceableEventDispatcherTest extends \PHPUnit_Framework_TestCase $dispatcher = new EventDispatcher(); $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch(), $logger); - $tdispatcher->addListener('foo', $listener1 = function () { ; }); - $tdispatcher->addListener('foo', $listener2 = function () { ; }); + $tdispatcher->addListener('foo', $listener1 = function () {; }); + $tdispatcher->addListener('foo', $listener2 = function () {; }); $logger->expects($this->at(0))->method('debug')->with("Notified event \"foo\" to listener \"closure\"."); $logger->expects($this->at(1))->method('debug')->with("Notified event \"foo\" to listener \"closure\"."); @@ -122,7 +122,7 @@ class TraceableEventDispatcherTest extends \PHPUnit_Framework_TestCase $dispatcher = new EventDispatcher(); $tdispatcher = new TraceableEventDispatcher($dispatcher, new Stopwatch(), $logger); $tdispatcher->addListener('foo', $listener1 = function (Event $event) { $event->stopPropagation(); }); - $tdispatcher->addListener('foo', $listener2 = function () { ; }); + $tdispatcher->addListener('foo', $listener2 = function () {; }); $logger->expects($this->at(0))->method('debug')->with("Notified event \"foo\" to listener \"closure\"."); $logger->expects($this->at(1))->method('debug')->with("Listener \"closure\" stopped propagation of the event \"foo\"."); diff --git a/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RegisterListenersPassTest.php b/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RegisterListenersPassTest.php index 8c9fa0856d..9fbb54f66a 100644 --- a/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RegisterListenersPassTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/DependencyInjection/RegisterListenersPassTest.php @@ -133,5 +133,7 @@ class RegisterListenersPassTest extends \PHPUnit_Framework_TestCase class SubscriberService implements \Symfony\Component\EventDispatcher\EventSubscriberInterface { - public static function getSubscribedEvents() {} + public static function getSubscribedEvents() + { + } } diff --git a/src/Symfony/Component/HttpKernel/Tests/EventListener/ExceptionListenerTest.php b/src/Symfony/Component/HttpKernel/Tests/EventListener/ExceptionListenerTest.php index c6a01281a7..a4ae8b8bb6 100644 --- a/src/Symfony/Component/HttpKernel/Tests/EventListener/ExceptionListenerTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/EventListener/ExceptionListenerTest.php @@ -108,7 +108,7 @@ class ExceptionListenerTest extends \PHPUnit_Framework_TestCase $event2 = new GetResponseForExceptionEvent(new TestKernelThatThrowsException(), $request, 'foo', $exception); return array( - array($event, $event2) + array($event, $event2), ); } diff --git a/src/Symfony/Component/HttpKernel/Tests/EventListener/ResponseListenerTest.php b/src/Symfony/Component/HttpKernel/Tests/EventListener/ResponseListenerTest.php index 3f8e852104..13f65109d9 100644 --- a/src/Symfony/Component/HttpKernel/Tests/EventListener/ResponseListenerTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/EventListener/ResponseListenerTest.php @@ -36,7 +36,6 @@ class ResponseListenerTest extends \PHPUnit_Framework_TestCase $this->dispatcher->addListener(KernelEvents::RESPONSE, array($listener, 'onKernelResponse')); $this->kernel = $this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface'); - } protected function tearDown() diff --git a/src/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionPresentBundle/Command/BarCommand.php b/src/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionPresentBundle/Command/BarCommand.php index b9a5417d94..0eb420f789 100644 --- a/src/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionPresentBundle/Command/BarCommand.php +++ b/src/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionPresentBundle/Command/BarCommand.php @@ -13,6 +13,5 @@ class BarCommand extends Command { public function __construct($example, $name = 'bar') { - } } diff --git a/src/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionPresentBundle/Command/FooCommand.php b/src/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionPresentBundle/Command/FooCommand.php index bfe189bea3..c6570aa046 100644 --- a/src/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionPresentBundle/Command/FooCommand.php +++ b/src/Symfony/Component/HttpKernel/Tests/Fixtures/ExtensionPresentBundle/Command/FooCommand.php @@ -19,5 +19,4 @@ class FooCommand extends Command { $this->setName('foo'); } - } diff --git a/src/Symfony/Component/HttpKernel/Tests/Fixtures/KernelForOverrideName.php b/src/Symfony/Component/HttpKernel/Tests/Fixtures/KernelForOverrideName.php index 32c05f4ba6..a1102ab784 100644 --- a/src/Symfony/Component/HttpKernel/Tests/Fixtures/KernelForOverrideName.php +++ b/src/Symfony/Component/HttpKernel/Tests/Fixtures/KernelForOverrideName.php @@ -20,11 +20,9 @@ class KernelForOverrideName extends Kernel public function registerBundles() { - } public function registerContainerConfiguration(LoaderInterface $loader) { - } } diff --git a/src/Symfony/Component/HttpKernel/Tests/Fragment/RoutableFragmentRendererTest.php b/src/Symfony/Component/HttpKernel/Tests/Fragment/RoutableFragmentRendererTest.php index c69bbc8e9a..f0a1cf4084 100644 --- a/src/Symfony/Component/HttpKernel/Tests/Fragment/RoutableFragmentRendererTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/Fragment/RoutableFragmentRendererTest.php @@ -62,8 +62,12 @@ class RoutableFragmentRendererTest extends \PHPUnit_Framework_TestCase class Renderer extends RoutableFragmentRenderer { - public function render($uri, Request $request, array $options = array()) {} - public function getName() {} + public function render($uri, Request $request, array $options = array()) + { + } + public function getName() + { + } public function doGenerateFragmentUri(ControllerReference $reference, Request $request, $absolute = false) { diff --git a/src/Symfony/Component/HttpKernel/Tests/KernelTest.php b/src/Symfony/Component/HttpKernel/Tests/KernelTest.php index a19bc32679..31665205cb 100644 --- a/src/Symfony/Component/HttpKernel/Tests/KernelTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/KernelTest.php @@ -497,7 +497,7 @@ EOF; $this->assertEquals(array( __DIR__.'/Fixtures/Bundle2Bundle/foo.txt', - __DIR__.'/Fixtures/Bundle1Bundle/foo.txt'), + __DIR__.'/Fixtures/Bundle1Bundle/foo.txt',), $kernel->locateResource('@Bundle1Bundle/foo.txt', null, false)); } @@ -509,7 +509,7 @@ EOF; ->method('getBundle') ->will($this->returnValue(array( $this->getBundle(__DIR__.'/Fixtures/Bundle1Bundle'), - $this->getBundle(__DIR__.'/Foobar') + $this->getBundle(__DIR__.'/Foobar'), ))) ; @@ -560,7 +560,7 @@ EOF; $this->assertEquals(array( __DIR__.'/Fixtures/Resources/Bundle1Bundle/foo.txt', - __DIR__.'/Fixtures/Bundle1Bundle/Resources/foo.txt'), + __DIR__.'/Fixtures/Bundle1Bundle/Resources/foo.txt',), $kernel->locateResource('@Bundle1Bundle/Resources/foo.txt', __DIR__.'/Fixtures/Resources', false) ); } diff --git a/src/Symfony/Component/HttpKernel/Tests/Profiler/Mock/RedisMock.php b/src/Symfony/Component/HttpKernel/Tests/Profiler/Mock/RedisMock.php index 13b726fdc4..60f5e42fc3 100644 --- a/src/Symfony/Component/HttpKernel/Tests/Profiler/Mock/RedisMock.php +++ b/src/Symfony/Component/HttpKernel/Tests/Profiler/Mock/RedisMock.php @@ -18,7 +18,6 @@ namespace Symfony\Component\HttpKernel\Tests\Profiler\Mock; */ class RedisMock { - private $connected; private $storage; diff --git a/src/Symfony/Component/HttpKernel/Tests/Profiler/MongoDbProfilerStorageTest.php b/src/Symfony/Component/HttpKernel/Tests/Profiler/MongoDbProfilerStorageTest.php index 15fe98695f..c72732563c 100644 --- a/src/Symfony/Component/HttpKernel/Tests/Profiler/MongoDbProfilerStorageTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/Profiler/MongoDbProfilerStorageTest.php @@ -77,23 +77,23 @@ class MongoDbProfilerStorageTest extends AbstractProfilerStorageTest array('mongodb://localhost/symfony_tests/profiler_data', array( 'mongodb://localhost/symfony_tests', 'symfony_tests', - 'profiler_data' + 'profiler_data', )), array('mongodb://user:password@localhost/symfony_tests/profiler_data', array( 'mongodb://user:password@localhost/symfony_tests', 'symfony_tests', - 'profiler_data' + 'profiler_data', )), array('mongodb://user:password@localhost/admin/symfony_tests/profiler_data', array( 'mongodb://user:password@localhost/admin', 'symfony_tests', - 'profiler_data' + 'profiler_data', )), array('mongodb://user:password@localhost:27009,localhost:27010/?replicaSet=rs-name&authSource=admin/symfony_tests/profiler_data', array( 'mongodb://user:password@localhost:27009,localhost:27010/?replicaSet=rs-name&authSource=admin', 'symfony_tests', - 'profiler_data' - )) + 'profiler_data', + )), ); } diff --git a/src/Symfony/Component/Intl/DateFormatter/DateFormat/AmPmTransformer.php b/src/Symfony/Component/Intl/DateFormatter/DateFormat/AmPmTransformer.php index eb61e2e7cc..31eca0d8f0 100644 --- a/src/Symfony/Component/Intl/DateFormatter/DateFormat/AmPmTransformer.php +++ b/src/Symfony/Component/Intl/DateFormatter/DateFormat/AmPmTransformer.php @@ -40,7 +40,7 @@ class AmPmTransformer extends Transformer public function extractDateOptions($matched, $length) { return array( - 'marker' => $matched + 'marker' => $matched, ); } } diff --git a/src/Symfony/Component/Intl/DateFormatter/DateFormat/FullTransformer.php b/src/Symfony/Component/Intl/DateFormatter/DateFormat/FullTransformer.php index d812cc4435..bfd1f32448 100644 --- a/src/Symfony/Component/Intl/DateFormatter/DateFormat/FullTransformer.php +++ b/src/Symfony/Component/Intl/DateFormatter/DateFormat/FullTransformer.php @@ -270,7 +270,7 @@ class FullTransformer $ret[$key[0]] = array( 'value' => $value, - 'pattern' => $key + 'pattern' => $key, ); } diff --git a/src/Symfony/Component/Intl/DateFormatter/DateFormat/Hour1200Transformer.php b/src/Symfony/Component/Intl/DateFormatter/DateFormat/Hour1200Transformer.php index a7a1794ae3..117b4f2223 100644 --- a/src/Symfony/Component/Intl/DateFormatter/DateFormat/Hour1200Transformer.php +++ b/src/Symfony/Component/Intl/DateFormatter/DateFormat/Hour1200Transformer.php @@ -56,7 +56,7 @@ class Hour1200Transformer extends HourTransformer { return array( 'hour' => (int) $matched, - 'hourInstance' => $this + 'hourInstance' => $this, ); } } diff --git a/src/Symfony/Component/Intl/DateFormatter/DateFormat/Hour1201Transformer.php b/src/Symfony/Component/Intl/DateFormatter/DateFormat/Hour1201Transformer.php index 8a6595718d..0a5d36f30c 100644 --- a/src/Symfony/Component/Intl/DateFormatter/DateFormat/Hour1201Transformer.php +++ b/src/Symfony/Component/Intl/DateFormatter/DateFormat/Hour1201Transformer.php @@ -56,7 +56,7 @@ class Hour1201Transformer extends HourTransformer { return array( 'hour' => (int) $matched, - 'hourInstance' => $this + 'hourInstance' => $this, ); } } diff --git a/src/Symfony/Component/Intl/DateFormatter/DateFormat/Hour2400Transformer.php b/src/Symfony/Component/Intl/DateFormatter/DateFormat/Hour2400Transformer.php index 64702685fb..337ba0ebfb 100644 --- a/src/Symfony/Component/Intl/DateFormatter/DateFormat/Hour2400Transformer.php +++ b/src/Symfony/Component/Intl/DateFormatter/DateFormat/Hour2400Transformer.php @@ -55,7 +55,7 @@ class Hour2400Transformer extends HourTransformer { return array( 'hour' => (int) $matched, - 'hourInstance' => $this + 'hourInstance' => $this, ); } } diff --git a/src/Symfony/Component/Intl/DateFormatter/DateFormat/Hour2401Transformer.php b/src/Symfony/Component/Intl/DateFormatter/DateFormat/Hour2401Transformer.php index 18a2b0bd03..082eabf942 100644 --- a/src/Symfony/Component/Intl/DateFormatter/DateFormat/Hour2401Transformer.php +++ b/src/Symfony/Component/Intl/DateFormatter/DateFormat/Hour2401Transformer.php @@ -58,7 +58,7 @@ class Hour2401Transformer extends HourTransformer { return array( 'hour' => (int) $matched, - 'hourInstance' => $this + 'hourInstance' => $this, ); } } diff --git a/src/Symfony/Component/Intl/DateFormatter/DateFormat/MonthTransformer.php b/src/Symfony/Component/Intl/DateFormatter/DateFormat/MonthTransformer.php index 874ace829b..7ed17c2293 100644 --- a/src/Symfony/Component/Intl/DateFormatter/DateFormat/MonthTransformer.php +++ b/src/Symfony/Component/Intl/DateFormatter/DateFormat/MonthTransformer.php @@ -33,7 +33,7 @@ class MonthTransformer extends Transformer 'September', 'October', 'November', - 'December' + 'December', ); /** diff --git a/src/Symfony/Component/Intl/DateFormatter/DateFormat/TimeZoneTransformer.php b/src/Symfony/Component/Intl/DateFormatter/DateFormat/TimeZoneTransformer.php index b94fccd36a..96111b725e 100644 --- a/src/Symfony/Component/Intl/DateFormatter/DateFormat/TimeZoneTransformer.php +++ b/src/Symfony/Component/Intl/DateFormatter/DateFormat/TimeZoneTransformer.php @@ -53,7 +53,7 @@ class TimeZoneTransformer extends Transformer public function extractDateOptions($matched, $length) { return array( - 'timezone' => self::getEtcTimeZoneId($matched) + 'timezone' => self::getEtcTimeZoneId($matched), ); } diff --git a/src/Symfony/Component/Intl/Intl.php b/src/Symfony/Component/Intl/Intl.php index df42a8c11c..a5db43ee84 100644 --- a/src/Symfony/Component/Intl/Intl.php +++ b/src/Symfony/Component/Intl/Intl.php @@ -207,5 +207,7 @@ class Intl /** * This class must not be instantiated. */ - private function __construct() {} + private function __construct() + { + } } diff --git a/src/Symfony/Component/Intl/Locale.php b/src/Symfony/Component/Intl/Locale.php index d7e0d33e84..87415d4515 100644 --- a/src/Symfony/Component/Intl/Locale.php +++ b/src/Symfony/Component/Intl/Locale.php @@ -44,5 +44,7 @@ final class Locale extends \Locale /** * This class must not be instantiated. */ - private function __construct() {} + private function __construct() + { + } } diff --git a/src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php b/src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php index 52868bb408..4d7131e6dc 100644 --- a/src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php +++ b/src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php @@ -154,7 +154,7 @@ class NumberFormatter private $attributes = array( self::FRACTION_DIGITS => 0, self::GROUPING_USED => 1, - self::ROUNDING_MODE => self::ROUND_HALFEVEN + self::ROUNDING_MODE => self::ROUND_HALFEVEN, ); /** @@ -171,7 +171,7 @@ class NumberFormatter */ private static $supportedStyles = array( 'CURRENCY' => self::CURRENCY, - 'DECIMAL' => self::DECIMAL + 'DECIMAL' => self::DECIMAL, ); /** @@ -182,7 +182,7 @@ class NumberFormatter private static $supportedAttributes = array( 'FRACTION_DIGITS' => self::FRACTION_DIGITS, 'GROUPING_USED' => self::GROUPING_USED, - 'ROUNDING_MODE' => self::ROUNDING_MODE + 'ROUNDING_MODE' => self::ROUNDING_MODE, ); /** @@ -195,7 +195,7 @@ class NumberFormatter private static $roundingModes = array( 'ROUND_HALFEVEN' => self::ROUND_HALFEVEN, 'ROUND_HALFDOWN' => self::ROUND_HALFDOWN, - 'ROUND_HALFUP' => self::ROUND_HALFUP + 'ROUND_HALFUP' => self::ROUND_HALFUP, ); /** @@ -209,7 +209,7 @@ class NumberFormatter private static $phpRoundingMap = array( self::ROUND_HALFDOWN => \PHP_ROUND_HALF_DOWN, self::ROUND_HALFEVEN => \PHP_ROUND_HALF_EVEN, - self::ROUND_HALFUP => \PHP_ROUND_HALF_UP + self::ROUND_HALFUP => \PHP_ROUND_HALF_UP, ); /** @@ -219,7 +219,7 @@ class NumberFormatter */ private static $int32Range = array( 'positive' => 2147483647, - 'negative' => -2147483648 + 'negative' => -2147483648, ); /** @@ -229,7 +229,7 @@ class NumberFormatter */ private static $int64Range = array( 'positive' => 9223372036854775807, - 'negative' => -9223372036854775808 + 'negative' => -9223372036854775808, ); private static $enSymbols = array( diff --git a/src/Symfony/Component/Intl/ResourceBundle/Compiler/BundleCompiler.php b/src/Symfony/Component/Intl/ResourceBundle/Compiler/BundleCompiler.php index 8249f66d0d..9075842b9a 100644 --- a/src/Symfony/Component/Intl/ResourceBundle/Compiler/BundleCompiler.php +++ b/src/Symfony/Component/Intl/ResourceBundle/Compiler/BundleCompiler.php @@ -38,7 +38,7 @@ class BundleCompiler implements BundleCompilerInterface */ public function __construct($genrb = 'genrb', $envVars = '') { - exec('which ' . $genrb, $output, $status); + exec('which '.$genrb, $output, $status); if (0 !== $status) { throw new RuntimeException(sprintf( @@ -47,7 +47,7 @@ class BundleCompiler implements BundleCompilerInterface )); } - $this->genrb = ($envVars ? $envVars . ' ' : '') . $genrb; + $this->genrb = ($envVars ? $envVars.' ' : '').$genrb; } /** diff --git a/src/Symfony/Component/Intl/ResourceBundle/Reader/BufferedBundleReader.php b/src/Symfony/Component/Intl/ResourceBundle/Reader/BufferedBundleReader.php index 19f6d672af..2a79385e61 100644 --- a/src/Symfony/Component/Intl/ResourceBundle/Reader/BufferedBundleReader.php +++ b/src/Symfony/Component/Intl/ResourceBundle/Reader/BufferedBundleReader.php @@ -45,7 +45,7 @@ class BufferedBundleReader implements BundleReaderInterface */ public function read($path, $locale) { - $hash = $path . '//' . $locale; + $hash = $path.'//'.$locale; if (!isset($this->buffer[$hash])) { $this->buffer[$hash] = $this->reader->read($path, $locale); diff --git a/src/Symfony/Component/Intl/ResourceBundle/Transformer/BundleTransformer.php b/src/Symfony/Component/Intl/ResourceBundle/Transformer/BundleTransformer.php index c613486f18..4f5a7a104b 100644 --- a/src/Symfony/Component/Intl/ResourceBundle/Transformer/BundleTransformer.php +++ b/src/Symfony/Component/Intl/ResourceBundle/Transformer/BundleTransformer.php @@ -57,7 +57,7 @@ class BundleTransformer $filesystem->mkdir($context->getBinaryDir()); foreach ($this->rules as $rule) { - $filesystem->mkdir($context->getBinaryDir() . '/' . $rule->getBundleName()); + $filesystem->mkdir($context->getBinaryDir().'/'.$rule->getBundleName()); $resources = (array) $rule->beforeCompile($context); @@ -70,7 +70,7 @@ class BundleTransformer )); } - $compiler->compile($resource, $context->getBinaryDir() . '/' . $rule->getBundleName()); + $compiler->compile($resource, $context->getBinaryDir().'/'.$rule->getBundleName()); } $rule->afterCompile($context); @@ -86,11 +86,11 @@ class BundleTransformer $filesystem->mkdir($context->getStubDir()); foreach ($this->rules as $rule) { - $filesystem->mkdir($context->getStubDir() . '/' . $rule->getBundleName()); + $filesystem->mkdir($context->getStubDir().'/'.$rule->getBundleName()); $data = $rule->beforeCreateStub($context); - $phpWriter->write($context->getStubDir() . '/' . $rule->getBundleName(), 'en', $data); + $phpWriter->write($context->getStubDir().'/'.$rule->getBundleName(), 'en', $data); $rule->afterCreateStub($context); } diff --git a/src/Symfony/Component/Intl/ResourceBundle/Transformer/Rule/CurrencyBundleTransformationRule.php b/src/Symfony/Component/Intl/ResourceBundle/Transformer/Rule/CurrencyBundleTransformationRule.php index d38cfc7b70..e594853657 100644 --- a/src/Symfony/Component/Intl/ResourceBundle/Transformer/Rule/CurrencyBundleTransformationRule.php +++ b/src/Symfony/Component/Intl/ResourceBundle/Transformer/Rule/CurrencyBundleTransformationRule.php @@ -43,12 +43,12 @@ class CurrencyBundleTransformationRule implements TransformationRuleInterface // in ICU <= 4.2 if (IcuVersion::compare($context->getIcuVersion(), '4.2', '<=', 1)) { return array( - $context->getSourceDir() . '/misc/supplementalData.txt', - $context->getSourceDir() . '/locales' + $context->getSourceDir().'/misc/supplementalData.txt', + $context->getSourceDir().'/locales', ); } - return $context->getSourceDir() . '/curr'; + return $context->getSourceDir().'/curr'; } /** @@ -59,8 +59,8 @@ class CurrencyBundleTransformationRule implements TransformationRuleInterface // \ResourceBundle does not like locale names with uppercase chars, so rename // the resource file // See: http://bugs.php.net/bug.php?id=54025 - $fileName = $context->getBinaryDir() . '/curr/supplementalData.res'; - $fileNameLower = $context->getBinaryDir() . '/curr/supplementaldata.res'; + $fileName = $context->getBinaryDir().'/curr/supplementalData.res'; + $fileNameLower = $context->getBinaryDir().'/curr/supplementaldata.res'; $context->getFilesystem()->rename($fileName, $fileNameLower); } diff --git a/src/Symfony/Component/Intl/ResourceBundle/Transformer/Rule/LanguageBundleTransformationRule.php b/src/Symfony/Component/Intl/ResourceBundle/Transformer/Rule/LanguageBundleTransformationRule.php index 7d78d74880..e55d84475d 100644 --- a/src/Symfony/Component/Intl/ResourceBundle/Transformer/Rule/LanguageBundleTransformationRule.php +++ b/src/Symfony/Component/Intl/ResourceBundle/Transformer/Rule/LanguageBundleTransformationRule.php @@ -40,10 +40,10 @@ class LanguageBundleTransformationRule implements TransformationRuleInterface { // The language data is contained in the locales bundle in ICU <= 4.2 if (IcuVersion::compare($context->getIcuVersion(), '4.2', '<=', 1)) { - return $context->getSourceDir() . '/locales'; + return $context->getSourceDir().'/locales'; } - return $context->getSourceDir() . '/lang'; + return $context->getSourceDir().'/lang'; } /** diff --git a/src/Symfony/Component/Intl/ResourceBundle/Transformer/Rule/LocaleBundleTransformationRule.php b/src/Symfony/Component/Intl/ResourceBundle/Transformer/Rule/LocaleBundleTransformationRule.php index 22ec911372..427b80e894 100644 --- a/src/Symfony/Component/Intl/ResourceBundle/Transformer/Rule/LocaleBundleTransformationRule.php +++ b/src/Symfony/Component/Intl/ResourceBundle/Transformer/Rule/LocaleBundleTransformationRule.php @@ -55,7 +55,7 @@ class LocaleBundleTransformationRule implements TransformationRuleInterface */ public function beforeCompile(CompilationContextInterface $context) { - $tempDir = sys_get_temp_dir() . '/icu-data-locales'; + $tempDir = sys_get_temp_dir().'/icu-data-locales'; $context->getFilesystem()->remove($tempDir); $context->getFilesystem()->mkdir($tempDir); @@ -70,7 +70,7 @@ class LocaleBundleTransformationRule implements TransformationRuleInterface */ public function afterCompile(CompilationContextInterface $context) { - $context->getFilesystem()->remove(sys_get_temp_dir() . '/icu-data-locales'); + $context->getFilesystem()->remove(sys_get_temp_dir().'/icu-data-locales'); } /** @@ -92,17 +92,17 @@ class LocaleBundleTransformationRule implements TransformationRuleInterface private function scanLocales(CompilationContextInterface $context) { - $tempDir = sys_get_temp_dir() . '/icu-data-locales-source'; + $tempDir = sys_get_temp_dir().'/icu-data-locales-source'; $context->getFilesystem()->remove($tempDir); $context->getFilesystem()->mkdir($tempDir); // Temporarily generate the resource bundles - $context->getCompiler()->compile($context->getSourceDir() . '/locales', $tempDir); + $context->getCompiler()->compile($context->getSourceDir().'/locales', $tempDir); // Discover the list of supported locales, which are the names of the resource // bundles in the "locales" directory - $locales = glob($tempDir . '/*.res'); + $locales = glob($tempDir.'/*.res'); // Remove file extension and sort array_walk($locales, function (&$locale) { $locale = basename($locale, '.res'); }); @@ -112,7 +112,7 @@ class LocaleBundleTransformationRule implements TransformationRuleInterface foreach ($locales as $key => $locale) { // Delete all aliases from the list // i.e., "az_AZ" is an alias for "az_Latn_AZ" - $content = file_get_contents($context->getSourceDir() . '/locales/' . $locale . '.txt'); + $content = file_get_contents($context->getSourceDir().'/locales/'.$locale.'.txt'); // The key "%%ALIAS" is not accessible through the \ResourceBundle class, // so look in the original .txt file instead @@ -129,7 +129,7 @@ class LocaleBundleTransformationRule implements TransformationRuleInterface } if (null === $bundle) { - throw new RuntimeException('The resource bundle for locale ' . $locale . ' could not be loaded from directory ' . $tempDir); + throw new RuntimeException('The resource bundle for locale '.$locale.' could not be loaded from directory '.$tempDir); } // There seems to be no other way for identifying all keys in this specific diff --git a/src/Symfony/Component/Intl/ResourceBundle/Transformer/Rule/RegionBundleTransformationRule.php b/src/Symfony/Component/Intl/ResourceBundle/Transformer/Rule/RegionBundleTransformationRule.php index 300ad02563..37cd40706b 100644 --- a/src/Symfony/Component/Intl/ResourceBundle/Transformer/Rule/RegionBundleTransformationRule.php +++ b/src/Symfony/Component/Intl/ResourceBundle/Transformer/Rule/RegionBundleTransformationRule.php @@ -40,10 +40,10 @@ class RegionBundleTransformationRule implements TransformationRuleInterface { // The region data is contained in the locales bundle in ICU <= 4.2 if (IcuVersion::compare($context->getIcuVersion(), '4.2', '<=', 1)) { - return $context->getSourceDir() . '/locales'; + return $context->getSourceDir().'/locales'; } - return $context->getSourceDir() . '/region'; + return $context->getSourceDir().'/region'; } /** diff --git a/src/Symfony/Component/Intl/ResourceBundle/Util/RecursiveArrayAccess.php b/src/Symfony/Component/Intl/ResourceBundle/Util/RecursiveArrayAccess.php index 0c22550401..3b34b9e1fe 100644 --- a/src/Symfony/Component/Intl/ResourceBundle/Util/RecursiveArrayAccess.php +++ b/src/Symfony/Component/Intl/ResourceBundle/Util/RecursiveArrayAccess.php @@ -35,7 +35,7 @@ class RecursiveArrayAccess continue; } } - + throw new OutOfBoundsException(sprintf( 'The index %s does not exist.', $index @@ -45,5 +45,7 @@ class RecursiveArrayAccess return $array; } - private function __construct() {} + private function __construct() + { + } } diff --git a/src/Symfony/Component/Intl/ResourceBundle/Writer/TextBundleWriter.php b/src/Symfony/Component/Intl/ResourceBundle/Writer/TextBundleWriter.php index 2aa702089f..0b3acc4dd6 100644 --- a/src/Symfony/Component/Intl/ResourceBundle/Writer/TextBundleWriter.php +++ b/src/Symfony/Component/Intl/ResourceBundle/Writer/TextBundleWriter.php @@ -87,7 +87,7 @@ class TextBundleWriter implements BundleWriterInterface $intValues = count($value) === count(array_filter($value, 'is_int')); $keys = array_keys($value); - + // check that the keys are 0-indexed and ascending $intKeys = $keys === range(0, count($keys) - 1); diff --git a/src/Symfony/Component/Intl/Resources/bin/autoload.php b/src/Symfony/Component/Intl/Resources/bin/autoload.php index e450011521..ae058fd70d 100644 --- a/src/Symfony/Component/Intl/Resources/bin/autoload.php +++ b/src/Symfony/Component/Intl/Resources/bin/autoload.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -$autoload = __DIR__ . '/../../vendor/autoload.php'; +$autoload = __DIR__.'/../../vendor/autoload.php'; if (!file_exists($autoload)) { bailout('You should run "composer install --dev" in the component before running this script.'); diff --git a/src/Symfony/Component/Intl/Resources/bin/copy-stubs-to-component.php b/src/Symfony/Component/Intl/Resources/bin/copy-stubs-to-component.php index 76eeecfc83..6f7e7a07c9 100644 --- a/src/Symfony/Component/Intl/Resources/bin/copy-stubs-to-component.php +++ b/src/Symfony/Component/Intl/Resources/bin/copy-stubs-to-component.php @@ -12,8 +12,8 @@ use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\Icu\IcuData; -require_once __DIR__ . '/common.php'; -require_once __DIR__ . '/autoload.php'; +require_once __DIR__.'/common.php'; +require_once __DIR__.'/autoload.php'; if (1 !== $GLOBALS['argc']) { bailout(<<exists($sourceDir)) { diff --git a/src/Symfony/Component/Intl/Resources/bin/create-stubs.php b/src/Symfony/Component/Intl/Resources/bin/create-stubs.php index d330d6b5fb..7dc3fcb6f4 100644 --- a/src/Symfony/Component/Intl/Resources/bin/create-stubs.php +++ b/src/Symfony/Component/Intl/Resources/bin/create-stubs.php @@ -19,8 +19,8 @@ use Symfony\Component\Intl\ResourceBundle\Transformer\Rule\LocaleBundleTransform use Symfony\Component\Intl\ResourceBundle\Transformer\Rule\RegionBundleTransformationRule; use Symfony\Component\Intl\ResourceBundle\Transformer\StubbingContext; -require_once __DIR__ . '/common.php'; -require_once __DIR__ . '/autoload.php'; +require_once __DIR__.'/common.php'; +require_once __DIR__.'/autoload.php'; if (1 !== $GLOBALS['argc']) { bailout(<<createStubs($context); echo "Wrote stubs to $targetDir.\n"; -$versionFile = $context->getStubDir() . '/version.txt'; +$versionFile = $context->getStubDir().'/version.txt'; file_put_contents($versionFile, "$icuVersionInIcuComponent\n"); diff --git a/src/Symfony/Component/Intl/Resources/bin/icu-version.php b/src/Symfony/Component/Intl/Resources/bin/icu-version.php index d54916f52b..9b5d2977a8 100644 --- a/src/Symfony/Component/Intl/Resources/bin/icu-version.php +++ b/src/Symfony/Component/Intl/Resources/bin/icu-version.php @@ -11,8 +11,8 @@ use Symfony\Component\Intl\Intl; -require_once __DIR__ . '/common.php'; -require_once __DIR__ . '/autoload.php'; +require_once __DIR__.'/common.php'; +require_once __DIR__.'/autoload.php'; echo "ICU version: "; -echo Intl::getIcuVersion() . "\n"; +echo Intl::getIcuVersion()."\n"; diff --git a/src/Symfony/Component/Intl/Resources/bin/test-compat.php b/src/Symfony/Component/Intl/Resources/bin/test-compat.php index c1bf40f794..22934bacfc 100644 --- a/src/Symfony/Component/Intl/Resources/bin/test-compat.php +++ b/src/Symfony/Component/Intl/Resources/bin/test-compat.php @@ -11,8 +11,8 @@ use Symfony\Component\Intl\Intl; -require_once __DIR__ . '/common.php'; -require_once __DIR__ . '/autoload.php'; +require_once __DIR__.'/common.php'; +require_once __DIR__.'/autoload.php'; if (1 !== $GLOBALS['argc']) { bailout(<<&1'); + run('git checkout '.$branch.' 2>&1'); - exec('php ' . __DIR__ . '/util/test-compat-helper.php > /dev/null 2> /dev/null', $output, $status); + exec('php '.__DIR__.'/util/test-compat-helper.php > /dev/null 2> /dev/null', $output, $status); - echo "$branch: " . (0 === $status ? "YES" : "NO") . "\n"; + echo "$branch: ".(0 === $status ? "YES" : "NO")."\n"; } echo "Done.\n"; diff --git a/src/Symfony/Component/Intl/Resources/bin/update-icu-component.php b/src/Symfony/Component/Intl/Resources/bin/update-icu-component.php index 2b94fe417f..3e6ed79c48 100644 --- a/src/Symfony/Component/Intl/Resources/bin/update-icu-component.php +++ b/src/Symfony/Component/Intl/Resources/bin/update-icu-component.php @@ -21,8 +21,8 @@ use Symfony\Component\Intl\ResourceBundle\Transformer\Rule\RegionBundleTransform use Symfony\Component\Intl\Util\SvnRepository; use Symfony\Component\Filesystem\Filesystem; -require_once __DIR__ . '/common.php'; -require_once __DIR__ . '/autoload.php'; +require_once __DIR__.'/common.php'; +require_once __DIR__.'/autoload.php'; if ($GLOBALS['argc'] > 3 || 2 === $GLOBALS['argc'] && '-h' === $GLOBALS['argv'][1]) { bailout(<<= 2) { } else { echo "Starting SVN checkout for version $shortIcuVersion. This may take a while...\n"; - $sourceDir = sys_get_temp_dir() . '/icu-data/' . $shortIcuVersion . '/source'; + $sourceDir = sys_get_temp_dir().'/icu-data/'.$shortIcuVersion.'/source'; $svn = SvnRepository::download($urls[$shortIcuVersion], $sourceDir); echo "SVN checkout to {$sourceDir} complete.\n"; @@ -104,70 +104,70 @@ if ($GLOBALS['argc'] >= 3) { echo "Running configure...\n"; - $buildDir = sys_get_temp_dir() . '/icu-data/' . $shortIcuVersion . '/build'; + $buildDir = sys_get_temp_dir().'/icu-data/'.$shortIcuVersion.'/build'; $filesystem->remove($buildDir); $filesystem->mkdir($buildDir); - run('./configure --prefix=' . $buildDir . ' 2>&1'); + run('./configure --prefix='.$buildDir.' 2>&1'); echo "Running make...\n"; // If the directory "lib" does not exist in the download, create it or we // will run into problems when building libicuuc.so. - $filesystem->mkdir($sourceDir . '/lib'); + $filesystem->mkdir($sourceDir.'/lib'); // If the directory "bin" does not exist in the download, create it or we // will run into problems when building genrb. - $filesystem->mkdir($sourceDir . '/bin'); + $filesystem->mkdir($sourceDir.'/bin'); echo "[1/5] libicudata.so..."; - cd($sourceDir . '/stubdata'); + cd($sourceDir.'/stubdata'); run('make 2>&1 && make install 2>&1'); echo " ok.\n"; echo "[2/5] libicuuc.so..."; - cd($sourceDir . '/common'); + cd($sourceDir.'/common'); run('make 2>&1 && make install 2>&1'); echo " ok.\n"; echo "[3/5] libicui18n.so..."; - cd($sourceDir . '/i18n'); + cd($sourceDir.'/i18n'); run('make 2>&1 && make install 2>&1'); echo " ok.\n"; echo "[4/5] libicutu.so..."; - cd($sourceDir . '/tools/toolutil'); + cd($sourceDir.'/tools/toolutil'); run('make 2>&1 && make install 2>&1'); echo " ok.\n"; echo "[5/5] genrb..."; - cd($sourceDir . '/tools/genrb'); + cd($sourceDir.'/tools/genrb'); run('make 2>&1 && make install 2>&1'); echo " ok.\n"; } -$genrb = $buildDir . '/bin/genrb'; -$genrbEnv = 'LD_LIBRARY_PATH=' . $buildDir . '/lib '; +$genrb = $buildDir.'/bin/genrb'; +$genrbEnv = 'LD_LIBRARY_PATH='.$buildDir.'/lib '; echo "Using $genrb.\n"; -$icuVersionInDownload = get_icu_version_from_genrb($genrbEnv . ' ' . $genrb); +$icuVersionInDownload = get_icu_version_from_genrb($genrbEnv.' '.$genrb); echo "Preparing resource bundle compilation (version $icuVersionInDownload)...\n"; $context = new CompilationContext( - $sourceDir . '/data', + $sourceDir.'/data', IcuData::getResourceDirectory(), $filesystem, new BundleCompiler($genrb, $genrbEnv), @@ -197,13 +197,13 @@ Date: {$svn->getLastCommit()->getDate()} SVN_INFO; -$svnInfoFile = $context->getBinaryDir() . '/svn-info.txt'; +$svnInfoFile = $context->getBinaryDir().'/svn-info.txt'; file_put_contents($svnInfoFile, $svnInfo); echo "Wrote $svnInfoFile.\n"; -$versionFile = $context->getBinaryDir() . '/version.txt'; +$versionFile = $context->getBinaryDir().'/version.txt'; file_put_contents($versionFile, "$icuVersionInDownload\n"); diff --git a/src/Symfony/Component/Intl/Resources/bin/util/test-compat-helper.php b/src/Symfony/Component/Intl/Resources/bin/util/test-compat-helper.php index 2734895c6d..648b09b0b5 100644 --- a/src/Symfony/Component/Intl/Resources/bin/util/test-compat-helper.php +++ b/src/Symfony/Component/Intl/Resources/bin/util/test-compat-helper.php @@ -12,12 +12,12 @@ use Symfony\Component\Icu\IcuData; use Symfony\Component\Intl\ResourceBundle\Reader\BinaryBundleReader; -require_once __DIR__ . '/../common.php'; -require_once __DIR__ . '/../autoload.php'; +require_once __DIR__.'/../common.php'; +require_once __DIR__.'/../autoload.php'; $reader = new BinaryBundleReader(); -$reader->read(IcuData::getResourceDirectory() . '/curr', 'en'); -$reader->read(IcuData::getResourceDirectory() . '/lang', 'en'); -$reader->read(IcuData::getResourceDirectory() . '/locales', 'en'); -$reader->read(IcuData::getResourceDirectory() . '/region', 'en'); +$reader->read(IcuData::getResourceDirectory().'/curr', 'en'); +$reader->read(IcuData::getResourceDirectory().'/lang', 'en'); +$reader->read(IcuData::getResourceDirectory().'/locales', 'en'); +$reader->read(IcuData::getResourceDirectory().'/region', 'en'); diff --git a/src/Symfony/Component/Intl/Resources/stubs/functions.php b/src/Symfony/Component/Intl/Resources/stubs/functions.php index b552d0e859..f787654717 100644 --- a/src/Symfony/Component/Intl/Resources/stubs/functions.php +++ b/src/Symfony/Component/Intl/Resources/stubs/functions.php @@ -12,7 +12,6 @@ use Symfony\Component\Intl\Globals\IntlGlobals; if (!function_exists('intl_is_failure')) { - /** * Stub implementation for the {@link intl_is_failure()} function of the intl * extension. @@ -76,5 +75,4 @@ if (!function_exists('intl_is_failure')) { { return IntlGlobals::getErrorName($errorCode); } - } diff --git a/src/Symfony/Component/Intl/Tests/DateFormatter/AbstractIntlDateFormatterTest.php b/src/Symfony/Component/Intl/Tests/DateFormatter/AbstractIntlDateFormatterTest.php index 1a68d90f42..2c6f5558ff 100644 --- a/src/Symfony/Component/Intl/Tests/DateFormatter/AbstractIntlDateFormatterTest.php +++ b/src/Symfony/Component/Intl/Tests/DateFormatter/AbstractIntlDateFormatterTest.php @@ -22,7 +22,6 @@ use Symfony\Component\Intl\Intl; */ abstract class AbstractIntlDateFormatterTest extends \PHPUnit_Framework_TestCase { - protected function setUp() { \Locale::setDefault('en'); @@ -272,7 +271,7 @@ abstract class AbstractIntlDateFormatterTest extends \PHPUnit_Framework_TestCase // With PHP 5.5 IntlDateFormatter accepts empty values ('0') if (version_compare(PHP_VERSION, '5.5.0-dev', '>=')) { return array( - array('y-M-d', 'foobar', 'datefmt_format: string \'foobar\' is not numeric, which would be required for it to be a valid date: U_ILLEGAL_ARGUMENT_ERROR') + array('y-M-d', 'foobar', 'datefmt_format: string \'foobar\' is not numeric, which would be required for it to be a valid date: U_ILLEGAL_ARGUMENT_ERROR'), ); } diff --git a/src/Symfony/Component/Intl/Tests/DateFormatter/IntlDateFormatterTest.php b/src/Symfony/Component/Intl/Tests/DateFormatter/IntlDateFormatterTest.php index 6464516734..212a115d6e 100644 --- a/src/Symfony/Component/Intl/Tests/DateFormatter/IntlDateFormatterTest.php +++ b/src/Symfony/Component/Intl/Tests/DateFormatter/IntlDateFormatterTest.php @@ -49,7 +49,7 @@ class IntlDateFormatterTest extends AbstractIntlDateFormatterTest 'tm_year' => 112, 'tm_wday' => 0, 'tm_yday' => 105, - 'tm_isdst' => 0 + 'tm_isdst' => 0, ); try { diff --git a/src/Symfony/Component/Intl/Tests/Locale/LocaleTest.php b/src/Symfony/Component/Intl/Tests/Locale/LocaleTest.php index 2a5d5d2db7..7da0e2a533 100644 --- a/src/Symfony/Component/Intl/Tests/Locale/LocaleTest.php +++ b/src/Symfony/Component/Intl/Tests/Locale/LocaleTest.php @@ -29,7 +29,7 @@ class LocaleTest extends AbstractLocaleTest $subtags = array( 'language' => 'pt', 'script' => 'Latn', - 'region' => 'BR' + 'region' => 'BR', ); $this->call('composeLocale', $subtags); } @@ -129,7 +129,7 @@ class LocaleTest extends AbstractLocaleTest { $langtag = array( 'pt-Latn-BR', - 'pt-BR' + 'pt-BR', ); $this->call('lookup', $langtag, 'pt-BR-x-priv1'); } diff --git a/src/Symfony/Component/Intl/Tests/NumberFormatter/AbstractNumberFormatterTest.php b/src/Symfony/Component/Intl/Tests/NumberFormatter/AbstractNumberFormatterTest.php index e1938de3fe..32f0579908 100644 --- a/src/Symfony/Component/Intl/Tests/NumberFormatter/AbstractNumberFormatterTest.php +++ b/src/Symfony/Component/Intl/Tests/NumberFormatter/AbstractNumberFormatterTest.php @@ -49,7 +49,7 @@ abstract class AbstractNumberFormatterTest extends \PHPUnit_Framework_TestCase array(1000.12, 'BRL', '1,000.12'), array(1000.12, 'CRC', '1,000.12'), array(1000.12, 'JPY', '1,000.12'), - array(1000.12, 'CHF', '1,000.12') + array(1000.12, 'CHF', '1,000.12'), ); } @@ -126,7 +126,7 @@ abstract class AbstractNumberFormatterTest extends \PHPUnit_Framework_TestCase array(1000.127, 'BRL', 'R', '%s$1,000.13'), array(1000.129, 'BRL', 'R', '%s$1,000.13'), array(11.50999, 'BRL', 'R', '%s$11.51'), - array(11.9999464, 'BRL', 'R', '%s$12.00') + array(11.9999464, 'BRL', 'R', '%s$12.00'), ); } @@ -159,7 +159,7 @@ abstract class AbstractNumberFormatterTest extends \PHPUnit_Framework_TestCase array(1200000.00, 'CHF', 'CHF', '%s1,200,000.00'), array(1200000.1, 'CHF', 'CHF', '%s1,200,000.10'), array(1200000.10, 'CHF', 'CHF', '%s1,200,000.10'), - array(1200000.101, 'CHF', 'CHF', '%s1,200,000.10') + array(1200000.101, 'CHF', 'CHF', '%s1,200,000.10'), ); } @@ -227,7 +227,7 @@ abstract class AbstractNumberFormatterTest extends \PHPUnit_Framework_TestCase array($formatter, 1, '¤1.00'), array($formatter, 1.1, '¤1.00'), array($formatter, 2147483648, '(¤2,147,483,648.00)', $message), - array($formatter, -2147483649, '¤2,147,483,647.00', $message) + array($formatter, -2147483649, '¤2,147,483,647.00', $message), ); } @@ -270,7 +270,7 @@ abstract class AbstractNumberFormatterTest extends \PHPUnit_Framework_TestCase array($formatter, 1, '¤1.00'), array($formatter, 1.1, '¤1.00'), array($formatter, 2147483648, '¤2,147,483,648.00'), - array($formatter, -2147483649, '(¤2,147,483,649.00)') + array($formatter, -2147483649, '(¤2,147,483,649.00)'), ); } @@ -369,7 +369,7 @@ abstract class AbstractNumberFormatterTest extends \PHPUnit_Framework_TestCase array(1.123, '1.1', 1, 1), array(1.123, '1.12', 2, 2), array(1.123, '1', -1, 0), - array(1.123, '1', 'abc', 0) + array(1.123, '1', 'abc', 0), ); } @@ -575,7 +575,7 @@ abstract class AbstractNumberFormatterTest extends \PHPUnit_Framework_TestCase array('2,147,483,647', 2147483647), array('-2,147,483,648', -2147483647 - 1), array('2,147,483,648', false, '->parse() TYPE_INT32 returns false when the number is greater than the integer positive range.'), - array('-2,147,483,649', false, '->parse() TYPE_INT32 returns false when the number is greater than the integer negative range.') + array('-2,147,483,649', false, '->parse() TYPE_INT32 returns false when the number is greater than the integer negative range.'), ); } diff --git a/src/Symfony/Component/Intl/Tests/ResourceBundle/Writer/PhpBundleWriterTest.php b/src/Symfony/Component/Intl/Tests/ResourceBundle/Writer/PhpBundleWriterTest.php index 03302834d7..f9e0de8e38 100644 --- a/src/Symfony/Component/Intl/Tests/ResourceBundle/Writer/PhpBundleWriterTest.php +++ b/src/Symfony/Component/Intl/Tests/ResourceBundle/Writer/PhpBundleWriterTest.php @@ -34,7 +34,7 @@ class PhpBundleWriterTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->writer = new PhpBundleWriter(); - $this->directory = sys_get_temp_dir() . '/PhpBundleWriterTest/' . rand(1000, 9999); + $this->directory = sys_get_temp_dir().'/PhpBundleWriterTest/'.rand(1000, 9999); $this->filesystem = new Filesystem(); $this->filesystem->mkdir($this->directory); @@ -57,6 +57,6 @@ class PhpBundleWriterTest extends \PHPUnit_Framework_TestCase 'Entry2' => 'String', )); - $this->assertFileEquals(__DIR__ . '/Fixtures/en.php', $this->directory . '/en.php'); + $this->assertFileEquals(__DIR__.'/Fixtures/en.php', $this->directory.'/en.php'); } } diff --git a/src/Symfony/Component/Intl/Tests/ResourceBundle/Writer/TextBundleWriterTest.php b/src/Symfony/Component/Intl/Tests/ResourceBundle/Writer/TextBundleWriterTest.php index f42b2738d7..b3304fbb06 100644 --- a/src/Symfony/Component/Intl/Tests/ResourceBundle/Writer/TextBundleWriterTest.php +++ b/src/Symfony/Component/Intl/Tests/ResourceBundle/Writer/TextBundleWriterTest.php @@ -92,7 +92,7 @@ class TextBundleWriterTest extends \PHPUnit_Framework_TestCase public function testWriteNoFallback() { $data = array( - 'Entry' => 'Value' + 'Entry' => 'Value', ); $this->writer->write($this->directory, 'en_nofallback', $data, $fallback = false); diff --git a/src/Symfony/Component/Intl/Util/IcuVersion.php b/src/Symfony/Component/Intl/Util/IcuVersion.php index 0eface090e..e0ff28ff68 100644 --- a/src/Symfony/Component/Intl/Util/IcuVersion.php +++ b/src/Symfony/Component/Intl/Util/IcuVersion.php @@ -101,5 +101,7 @@ class IcuVersion /** * Must not be instantiated. */ - private function __construct() {} + private function __construct() + { + } } diff --git a/src/Symfony/Component/Intl/Util/IntlTestHelper.php b/src/Symfony/Component/Intl/Util/IntlTestHelper.php index cace36c6f5..d903523668 100644 --- a/src/Symfony/Component/Intl/Util/IntlTestHelper.php +++ b/src/Symfony/Component/Intl/Util/IntlTestHelper.php @@ -40,11 +40,11 @@ class IntlTestHelper // * the intl extension is not loaded if (IcuVersion::compare(Intl::getIcuVersion(), Intl::getIcuStubVersion(), '!=', 1)) { - $testCase->markTestSkipped('Please change ICU version to ' . Intl::getIcuStubVersion()); + $testCase->markTestSkipped('Please change ICU version to '.Intl::getIcuStubVersion()); } if (IcuVersion::compare(Intl::getIcuDataVersion(), Intl::getIcuStubVersion(), '!=', 1)) { - $testCase->markTestSkipped('Please change the Icu component to version 1.0.x or 1.' . IcuVersion::normalize(Intl::getIcuStubVersion(), 1) . '.x'); + $testCase->markTestSkipped('Please change the Icu component to version 1.0.x or 1.'.IcuVersion::normalize(Intl::getIcuStubVersion(), 1).'.x'); } // Normalize the default locale in case this is not done explicitly @@ -76,12 +76,12 @@ class IntlTestHelper // ... and only if the version is *one specific version* ... if (IcuVersion::compare(Intl::getIcuVersion(), Intl::getIcuStubVersion(), '!=', 1)) { - $testCase->markTestSkipped('Please change ICU version to ' . Intl::getIcuStubVersion()); + $testCase->markTestSkipped('Please change ICU version to '.Intl::getIcuStubVersion()); } // ... and only if the data in the Icu component matches that version. if (IcuVersion::compare(Intl::getIcuDataVersion(), Intl::getIcuStubVersion(), '!=', 1)) { - $testCase->markTestSkipped('Please change the Icu component to version 1.0.x or 1.' . IcuVersion::normalize(Intl::getIcuStubVersion(), 1) . '.x'); + $testCase->markTestSkipped('Please change the Icu component to version 1.0.x or 1.'.IcuVersion::normalize(Intl::getIcuStubVersion(), 1).'.x'); } // Normalize the default locale in case this is not done explicitly @@ -124,5 +124,7 @@ class IntlTestHelper /** * Must not be instantiated. */ - private function __construct() {} + private function __construct() + { + } } diff --git a/src/Symfony/Component/Intl/Util/SvnRepository.php b/src/Symfony/Component/Intl/Util/SvnRepository.php index 3fb3acb4fd..3b891b380c 100644 --- a/src/Symfony/Component/Intl/Util/SvnRepository.php +++ b/src/Symfony/Component/Intl/Util/SvnRepository.php @@ -56,14 +56,14 @@ class SvnRepository $filesystem = new Filesystem(); - if (!$filesystem->exists($targetDir . '/.svn')) { + if (!$filesystem->exists($targetDir.'/.svn')) { $filesystem->remove($targetDir); $filesystem->mkdir($targetDir); - exec('svn checkout ' . $url . ' ' . $targetDir, $output, $result); + exec('svn checkout '.$url.' '.$targetDir, $output, $result); if ($result !== 0) { - throw new RuntimeException('The SVN checkout of ' . $url . 'failed.'); + throw new RuntimeException('The SVN checkout of '.$url.'failed.'); } } diff --git a/src/Symfony/Component/Intl/Util/Version.php b/src/Symfony/Component/Intl/Util/Version.php index d767b17c99..addf01eaf6 100644 --- a/src/Symfony/Component/Intl/Util/Version.php +++ b/src/Symfony/Component/Intl/Util/Version.php @@ -73,7 +73,7 @@ class Version public static function normalize($version, $precision) { if (null === $precision) { - return $version; + return $version; } $pattern = '[^\.]+'; @@ -82,7 +82,7 @@ class Version $pattern = sprintf('[^\.]+(\.%s)?', $pattern); } - if (!preg_match('/^' . $pattern . '/', $version, $matches)) { + if (!preg_match('/^'.$pattern.'/', $version, $matches)) { return; } @@ -92,5 +92,7 @@ class Version /** * Must not be instantiated. */ - private function __construct() {} + private function __construct() + { + } } diff --git a/src/Symfony/Component/Locale/Stub/StubLocale.php b/src/Symfony/Component/Locale/Stub/StubLocale.php index a4b554be6c..ceb34755e4 100644 --- a/src/Symfony/Component/Locale/Stub/StubLocale.php +++ b/src/Symfony/Component/Locale/Stub/StubLocale.php @@ -101,7 +101,7 @@ class StubLocale extends Locale 'name' => $name, 'symbol' => $bundle->getCurrencySymbol($currency, $locale), 'fractionDigits' => $bundle->getFractionDigits($currency), - 'roundingIncrement' => $bundle->getRoundingIncrement($currency) + 'roundingIncrement' => $bundle->getRoundingIncrement($currency), ); self::$currenciesNames[$currency] = $name; } diff --git a/src/Symfony/Component/OptionsResolver/Tests/OptionsResolverTest.php b/src/Symfony/Component/OptionsResolver/Tests/OptionsResolverTest.php index d50cd3fcfe..2bfe3469d1 100644 --- a/src/Symfony/Component/OptionsResolver/Tests/OptionsResolverTest.php +++ b/src/Symfony/Component/OptionsResolver/Tests/OptionsResolverTest.php @@ -623,7 +623,7 @@ class OptionsResolverTest extends \PHPUnit_Framework_TestCase )); $this->assertEquals(array( - 'foo' => 'bar' + 'foo' => 'bar', ), $this->resolver->resolve(array())); } @@ -637,7 +637,7 @@ class OptionsResolverTest extends \PHPUnit_Framework_TestCase )); $this->assertEquals(array( - 'foo' => 'bar' + 'foo' => 'bar', ), $this->resolver->resolve(array())); } @@ -652,7 +652,7 @@ class OptionsResolverTest extends \PHPUnit_Framework_TestCase $options = array( 'one' => '1', - 'two' => '2' + 'two' => '2', ); $this->assertEquals($options, $this->resolver->resolve($options)); diff --git a/src/Symfony/Component/OptionsResolver/Tests/OptionsTest.php b/src/Symfony/Component/OptionsResolver/Tests/OptionsTest.php index e24a764714..5db0995685 100644 --- a/src/Symfony/Component/OptionsResolver/Tests/OptionsTest.php +++ b/src/Symfony/Component/OptionsResolver/Tests/OptionsTest.php @@ -372,7 +372,7 @@ class OptionsTest extends \PHPUnit_Framework_TestCase 'two' => '2', 'three' => function (Options $options) { return '2' === $options['two'] ? '3' : 'foo'; - } + }, )); $this->assertEquals(array( @@ -389,7 +389,6 @@ class OptionsTest extends \PHPUnit_Framework_TestCase $this->options->clear(); $this->assertEmpty($this->options->all()); - } /** diff --git a/src/Symfony/Component/Process/Process.php b/src/Symfony/Component/Process/Process.php index 3185633fbf..908a126ffa 100644 --- a/src/Symfony/Component/Process/Process.php +++ b/src/Symfony/Component/Process/Process.php @@ -315,7 +315,7 @@ class Process do { $this->checkTimeout(); $running = defined('PHP_WINDOWS_VERSION_BUILD') ? $this->isRunning() : $this->processPipes->hasOpenHandles(); - $close = !defined('PHP_WINDOWS_VERSION_BUILD') || !$running;; + $close = !defined('PHP_WINDOWS_VERSION_BUILD') || !$running; $this->readPipes(true, $close); } while ($running); diff --git a/src/Symfony/Component/Process/Tests/AbstractProcessTest.php b/src/Symfony/Component/Process/Tests/AbstractProcessTest.php index b78c4777be..42435af886 100644 --- a/src/Symfony/Component/Process/Tests/AbstractProcessTest.php +++ b/src/Symfony/Component/Process/Tests/AbstractProcessTest.php @@ -145,7 +145,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase */ public function testProcessPipes($code, $size) { - $expected = str_repeat(str_repeat('*', 1024), $size) . '!'; + $expected = str_repeat(str_repeat('*', 1024), $size).'!'; $expectedLength = (1024 * $size) + 1; $p = $this->getProcess(sprintf('php -r %s', escapeshellarg($code))); @@ -215,7 +215,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase { if (defined('PHP_WINDOWS_VERSION_BUILD')) { return array( - array("2 \r\n2\r\n", '&&', '2') + array("2 \r\n2\r\n", '&&', '2'), ); } @@ -611,7 +611,6 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase $process->run(); $this->fail('A RuntimeException should have been raised'); } catch (RuntimeException $e) { - } $duration = microtime(true) - $start; @@ -655,7 +654,6 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase } $this->fail('A RuntimeException should have been raised'); } catch (RuntimeException $e) { - } $duration = microtime(true) - $start; @@ -671,7 +669,6 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase $process->run(); $this->fail('An exception should have been raised.'); } catch (\Exception $e) { - } $process->start(); usleep(10000); @@ -703,7 +700,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase { $this->verifyPosixIsEnabled(); - $process = $this->getProcess('exec php -f ' . __DIR__ . '/SignalListener.php'); + $process = $this->getProcess('exec php -f '.__DIR__.'/SignalListener.php'); $process->start(); usleep(500000); $process->signal(SIGUSR1); @@ -875,7 +872,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase array('WorkingDirectory'), array('Env'), array('Stdin'), - array('Options') + array('Options'), ); return $defaults; diff --git a/src/Symfony/Component/Process/Tests/NonStopableProcess.php b/src/Symfony/Component/Process/Tests/NonStopableProcess.php index d81abf4040..2183e48c64 100644 --- a/src/Symfony/Component/Process/Tests/NonStopableProcess.php +++ b/src/Symfony/Component/Process/Tests/NonStopableProcess.php @@ -18,14 +18,14 @@ function handleSignal($signal) $name = 'SIGINT'; break; default: - $name = $signal . ' (unknown)'; + $name = $signal.' (unknown)'; break; } echo "received signal $name\n"; } -declare(ticks = 1); +declare (ticks = 1); pcntl_signal(SIGTERM, 'handleSignal'); pcntl_signal(SIGINT, 'handleSignal'); diff --git a/src/Symfony/Component/Process/Tests/PipeStdinInStdoutStdErrStreamSelect.php b/src/Symfony/Component/Process/Tests/PipeStdinInStdoutStdErrStreamSelect.php index cdc75255e7..89d1f6a1ac 100644 --- a/src/Symfony/Component/Process/Tests/PipeStdinInStdoutStdErrStreamSelect.php +++ b/src/Symfony/Component/Process/Tests/PipeStdinInStdoutStdErrStreamSelect.php @@ -26,22 +26,22 @@ while ($read || $write) { } if (in_array(STDOUT, $w) && strlen($out) > 0) { - $written = fwrite(STDOUT, (binary) $out, 32768); - if (false === $written) { - die(ERR_WRITE_FAILED); - } - $out = (binary) substr($out, $written); + $written = fwrite(STDOUT, (binary) $out, 32768); + if (false === $written) { + die(ERR_WRITE_FAILED); + } + $out = (binary) substr($out, $written); } if (null === $read && strlen($out) < 1) { $write = array_diff($write, array(STDOUT)); } if (in_array(STDERR, $w) && strlen($err) > 0) { - $written = fwrite(STDERR, (binary) $err, 32768); - if (false === $written) { - die(ERR_WRITE_FAILED); - } - $err = (binary) substr($err, $written); + $written = fwrite(STDERR, (binary) $err, 32768); + if (false === $written) { + die(ERR_WRITE_FAILED); + } + $err = (binary) substr($err, $written); } if (null === $read && strlen($err) < 1) { $write = array_diff($write, array(STDERR)); diff --git a/src/Symfony/Component/Process/Tests/SignalListener.php b/src/Symfony/Component/Process/Tests/SignalListener.php index 143515d4dc..32910e1706 100644 --- a/src/Symfony/Component/Process/Tests/SignalListener.php +++ b/src/Symfony/Component/Process/Tests/SignalListener.php @@ -1,11 +1,11 @@ readPropertiesUntil($objectOrArray, $propertyPath, $propertyPath->getLength()); + $propertyValues = & $this->readPropertiesUntil($objectOrArray, $propertyPath, $propertyPath->getLength()); return $propertyValues[count($propertyValues) - 1][self::VALUE]; } @@ -62,7 +62,7 @@ class PropertyAccessor implements PropertyAccessorInterface throw new UnexpectedTypeException($propertyPath, 'string or Symfony\Component\PropertyAccess\PropertyPathInterface'); } - $propertyValues =& $this->readPropertiesUntil($objectOrArray, $propertyPath, $propertyPath->getLength() - 1); + $propertyValues = & $this->readPropertiesUntil($objectOrArray, $propertyPath, $propertyPath->getLength() - 1); $overwrite = true; // Add the root object to the list @@ -72,7 +72,7 @@ class PropertyAccessor implements PropertyAccessorInterface )); for ($i = count($propertyValues) - 1; $i >= 0; --$i) { - $objectOrArray =& $propertyValues[$i][self::VALUE]; + $objectOrArray = & $propertyValues[$i][self::VALUE]; if ($overwrite) { if (!is_object($objectOrArray) && !is_array($objectOrArray)) { @@ -90,7 +90,7 @@ class PropertyAccessor implements PropertyAccessorInterface } } - $value =& $objectOrArray; + $value = & $objectOrArray; $overwrite = !$propertyValues[$i][self::IS_REF]; } } @@ -125,14 +125,14 @@ class PropertyAccessor implements PropertyAccessorInterface } if ($isIndex) { - $propertyValue =& $this->readIndex($objectOrArray, $property); + $propertyValue = & $this->readIndex($objectOrArray, $property); } else { - $propertyValue =& $this->readProperty($objectOrArray, $property); + $propertyValue = & $this->readProperty($objectOrArray, $property); } - $objectOrArray =& $propertyValue[self::VALUE]; + $objectOrArray = & $propertyValue[self::VALUE]; - $propertyValues[] =& $propertyValue; + $propertyValues[] = & $propertyValue; } return $propertyValues; @@ -157,12 +157,12 @@ class PropertyAccessor implements PropertyAccessorInterface // Use an array instead of an object since performance is very crucial here $result = array( self::VALUE => null, - self::IS_REF => false + self::IS_REF => false, ); if (isset($array[$index])) { if (is_array($array)) { - $result[self::VALUE] =& $array[$index]; + $result[self::VALUE] = & $array[$index]; $result[self::IS_REF] = true; } else { $result[self::VALUE] = $array[$index]; @@ -191,7 +191,7 @@ class PropertyAccessor implements PropertyAccessorInterface // very crucial here $result = array( self::VALUE => null, - self::IS_REF => false + self::IS_REF => false, ); if (!is_object($object)) { @@ -214,7 +214,7 @@ class PropertyAccessor implements PropertyAccessorInterface } elseif ($reflClass->hasMethod('__get') && $reflClass->getMethod('__get')->isPublic()) { $result[self::VALUE] = $object->$property; } elseif ($classHasProperty && $reflClass->getProperty($property)->isPublic()) { - $result[self::VALUE] =& $object->$property; + $result[self::VALUE] = & $object->$property; $result[self::IS_REF] = true; } elseif (!$classHasProperty && property_exists($object, $property)) { // Needed to support \stdClass instances. We need to explicitly @@ -222,7 +222,7 @@ class PropertyAccessor implements PropertyAccessorInterface // a *protected* property was found on the class, property_exists() // returns true, consequently the following line will result in a // fatal error. - $result[self::VALUE] =& $object->$property; + $result[self::VALUE] = & $object->$property; $result[self::IS_REF] = true; } elseif ($this->magicCall && $reflClass->hasMethod('__call') && $reflClass->getMethod('__call')->isPublic()) { // we call the getter and hope the __call do the job diff --git a/src/Symfony/Component/PropertyAccess/PropertyPathBuilder.php b/src/Symfony/Component/PropertyAccess/PropertyPathBuilder.php index af2c46f904..3567a6f2d8 100644 --- a/src/Symfony/Component/PropertyAccess/PropertyPathBuilder.php +++ b/src/Symfony/Component/PropertyAccess/PropertyPathBuilder.php @@ -129,7 +129,7 @@ class PropertyPathBuilder if ($offset < 0 && abs($offset) <= $this->getLength()) { $offset = $this->getLength() + $offset; } elseif (!isset($this->elements[$offset])) { - throw new OutOfBoundsException('The offset ' . $offset . ' is not within the property path'); + throw new OutOfBoundsException('The offset '.$offset.' is not within the property path'); } if (0 === $pathLength) { diff --git a/src/Symfony/Component/PropertyAccess/StringUtil.php b/src/Symfony/Component/PropertyAccess/StringUtil.php index dd9ee3496c..cceac9b42f 100644 --- a/src/Symfony/Component/PropertyAccess/StringUtil.php +++ b/src/Symfony/Component/PropertyAccess/StringUtil.php @@ -114,7 +114,9 @@ class StringUtil /** * This class should not be instantiated */ - private function __construct() {} + private function __construct() + { + } /** * Returns the singular form of a word diff --git a/src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorCollectionTest.php b/src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorCollectionTest.php index 7da0c068dd..08e6e5e6d0 100644 --- a/src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorCollectionTest.php +++ b/src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorCollectionTest.php @@ -48,11 +48,17 @@ class PropertyAccessorCollectionTest_Car class PropertyAccessorCollectionTest_CarCustomSingular { - public function addFoo($axis) {} + public function addFoo($axis) + { + } - public function removeFoo($axis) {} + public function removeFoo($axis) + { + } - public function getAxes() {} + public function getAxes() + { + } } class PropertyAccessorCollectionTest_Engine @@ -61,44 +67,66 @@ class PropertyAccessorCollectionTest_Engine class PropertyAccessorCollectionTest_CarOnlyAdder { - public function addAxis($axis) {} + public function addAxis($axis) + { + } - public function getAxes() {} + public function getAxes() + { + } } class PropertyAccessorCollectionTest_CarOnlyRemover { - public function removeAxis($axis) {} + public function removeAxis($axis) + { + } - public function getAxes() {} + public function getAxes() + { + } } class PropertyAccessorCollectionTest_CarNoAdderAndRemover { - public function getAxes() {} + public function getAxes() + { + } } class PropertyAccessorCollectionTest_CarNoAdderAndRemoverWithProperty { protected $axes = array(); - public function getAxes() {} + public function getAxes() + { + } } class PropertyAccessorCollectionTest_CompositeCar { - public function getStructure() {} + public function getStructure() + { + } - public function setStructure($structure) {} + public function setStructure($structure) + { + } } class PropertyAccessorCollectionTest_CarStructure { - public function addAxis($axis) {} + public function addAxis($axis) + { + } - public function removeAxis($axis) {} + public function removeAxis($axis) + { + } - public function getAxes() {} + public function getAxes() + { + } } abstract class PropertyAccessorCollectionTest extends \PHPUnit_Framework_TestCase diff --git a/src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorTest.php b/src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorTest.php index e22ca097be..f788d3284b 100644 --- a/src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorTest.php +++ b/src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorTest.php @@ -379,5 +379,4 @@ class PropertyAccessorTest extends \PHPUnit_Framework_TestCase $this->assertEquals('foobar', $object->getMagicProperty()); } - } diff --git a/src/Symfony/Component/PropertyAccess/Tests/PropertyPathBuilderTest.php b/src/Symfony/Component/PropertyAccess/Tests/PropertyPathBuilderTest.php index 14300b1ded..5955049246 100644 --- a/src/Symfony/Component/PropertyAccess/Tests/PropertyPathBuilderTest.php +++ b/src/Symfony/Component/PropertyAccess/Tests/PropertyPathBuilderTest.php @@ -77,7 +77,7 @@ class PropertyPathBuilderTest extends \PHPUnit_Framework_TestCase { $this->builder->append('new1[new2]'); - $path = new PropertyPath(self::PREFIX . '.new1[new2]'); + $path = new PropertyPath(self::PREFIX.'.new1[new2]'); $this->assertEquals($path, $this->builder->getPropertyPath()); } diff --git a/src/Symfony/Component/PropertyAccess/Tests/StringUtilTest.php b/src/Symfony/Component/PropertyAccess/Tests/StringUtilTest.php index 1aff522981..a9c07162fe 100644 --- a/src/Symfony/Component/PropertyAccess/Tests/StringUtilTest.php +++ b/src/Symfony/Component/PropertyAccess/Tests/StringUtilTest.php @@ -151,9 +151,9 @@ class StringUtilTest extends \PHPUnit_Framework_TestCase { $single = StringUtil::singularify($plural); if (is_string($singular) && is_array($single)) { - $this->fail("--- Expected\n`string`: " . $singular . "\n+++ Actual\n`array`: " . implode(', ', $single)); + $this->fail("--- Expected\n`string`: ".$singular."\n+++ Actual\n`array`: ".implode(', ', $single)); } elseif (is_array($singular) && is_string($single)) { - $this->fail("--- Expected\n`array`: " . implode(', ', $singular) . "\n+++ Actual\n`string`: " . $single); + $this->fail("--- Expected\n`array`: ".implode(', ', $singular)."\n+++ Actual\n`string`: ".$single); } $this->assertEquals($singular, $single); diff --git a/src/Symfony/Component/Routing/CompiledRoute.php b/src/Symfony/Component/Routing/CompiledRoute.php index 7878455427..5e4c96073e 100644 --- a/src/Symfony/Component/Routing/CompiledRoute.php +++ b/src/Symfony/Component/Routing/CompiledRoute.php @@ -130,5 +130,4 @@ class CompiledRoute { return $this->hostVariables; } - } diff --git a/src/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php b/src/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php index 01d8c03589..9ff74499c3 100644 --- a/src/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php +++ b/src/Symfony/Component/Routing/Matcher/Dumper/ApacheMatcherDumper.php @@ -50,7 +50,6 @@ class ApacheMatcherDumper extends MatcherDumper $prevHostRegex = ''; foreach ($this->getRoutes()->all() as $name => $route) { - $compiledRoute = $route->compile(); $hostRegex = $compiledRoute->getHostRegex(); diff --git a/src/Symfony/Component/Routing/Matcher/Dumper/DumperPrefixCollection.php b/src/Symfony/Component/Routing/Matcher/Dumper/DumperPrefixCollection.php index 99cd3caae6..3563d5149f 100644 --- a/src/Symfony/Component/Routing/Matcher/Dumper/DumperPrefixCollection.php +++ b/src/Symfony/Component/Routing/Matcher/Dumper/DumperPrefixCollection.php @@ -57,7 +57,6 @@ class DumperPrefixCollection extends DumperCollection $prefix = $route->getRoute()->compile()->getStaticPrefix(); for ($collection = $this; null !== $collection; $collection = $collection->getParent()) { - // Same prefix, add to current leave if ($collection->prefix === $prefix) { $collection->add($route); diff --git a/src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php b/src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php index e378d67ff9..195c56e99e 100644 --- a/src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php +++ b/src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php @@ -307,7 +307,6 @@ EOF; $code .= sprintf(" return \$this->mergeDefaults(array_replace(%s), %s);\n" , implode(', ', $vars), str_replace("\n", '', var_export($route->getDefaults(), true))); - } elseif ($route->getDefaults()) { $code .= sprintf(" return %s;\n", str_replace("\n", '', var_export(array_replace($route->getDefaults(), array('_route' => $name)), true))); } else { diff --git a/src/Symfony/Component/Routing/Tests/Annotation/RouteTest.php b/src/Symfony/Component/Routing/Tests/Annotation/RouteTest.php index b58869f7af..50b85e3dd6 100644 --- a/src/Symfony/Component/Routing/Tests/Annotation/RouteTest.php +++ b/src/Symfony/Component/Routing/Tests/Annotation/RouteTest.php @@ -43,7 +43,7 @@ class RouteTest extends \PHPUnit_Framework_TestCase array('defaults', array('_controller' => 'MyBlogBundle:Blog:index'), 'getDefaults'), array('schemes', array('https'), 'getSchemes'), array('methods', array('GET', 'POST'), 'getMethods'), - array('host', array('{locale}.example.com'), 'getHost') + array('host', array('{locale}.example.com'), 'getHost'), ); } } diff --git a/src/Symfony/Component/Routing/Tests/Fixtures/validpattern.php b/src/Symfony/Component/Routing/Tests/Fixtures/validpattern.php index b8bbbb5f8f..f1ecfe9418 100644 --- a/src/Symfony/Component/Routing/Tests/Fixtures/validpattern.php +++ b/src/Symfony/Component/Routing/Tests/Fixtures/validpattern.php @@ -15,7 +15,7 @@ $collection->add('blog_show', new Route( $collection->add('blog_show_legacy', new Route( '/blog/{slug}', array('_controller' => 'MyBlogBundle:Blog:show'), - array('_method' => 'GET|POST|put|OpTiOnS', '_scheme' => 'https', 'locale' => '\w+',), + array('_method' => 'GET|POST|put|OpTiOnS', '_scheme' => 'https', 'locale' => '\w+'), array('compiler_class' => 'RouteCompiler'), '{locale}.example.com' )); diff --git a/src/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php b/src/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php index 5f8ef49127..3b8c6cb748 100644 --- a/src/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php +++ b/src/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php @@ -320,7 +320,7 @@ class UrlGeneratorTest extends \PHPUnit_Framework_TestCase .'?query=%40%3A%5B%5D%2F%28%29%2A%27%22+%2B%2C%3B-._%7E%26%24%3C%3E%7C%7B%7D%25%5C%5E%60%21%3Ffoo%3Dbar%23id', $this->getGenerator($routes)->generate('test', array( 'varpath' => $chars, - 'query' => $chars + 'query' => $chars, )) ); } @@ -395,21 +395,21 @@ class UrlGeneratorTest extends \PHPUnit_Framework_TestCase { $routes = $this->getRoutes('test', new Route('/{name}', array(), array(), array(), '{locale}.example.com')); - $this->assertEquals('//fr.example.com/app.php/Fabien', $this->getGenerator($routes)->generate('test', array('name' =>'Fabien', 'locale' => 'fr'))); + $this->assertEquals('//fr.example.com/app.php/Fabien', $this->getGenerator($routes)->generate('test', array('name' => 'Fabien', 'locale' => 'fr'))); } public function testWithHostSameAsContext() { $routes = $this->getRoutes('test', new Route('/{name}', array(), array(), array(), '{locale}.example.com')); - $this->assertEquals('/app.php/Fabien', $this->getGenerator($routes, array('host' => 'fr.example.com'))->generate('test', array('name' =>'Fabien', 'locale' => 'fr'))); + $this->assertEquals('/app.php/Fabien', $this->getGenerator($routes, array('host' => 'fr.example.com'))->generate('test', array('name' => 'Fabien', 'locale' => 'fr'))); } public function testWithHostSameAsContextAndAbsolute() { $routes = $this->getRoutes('test', new Route('/{name}', array(), array(), array(), '{locale}.example.com')); - $this->assertEquals('http://fr.example.com/app.php/Fabien', $this->getGenerator($routes, array('host' => 'fr.example.com'))->generate('test', array('name' =>'Fabien', 'locale' => 'fr'), true)); + $this->assertEquals('http://fr.example.com/app.php/Fabien', $this->getGenerator($routes, array('host' => 'fr.example.com'))->generate('test', array('name' => 'Fabien', 'locale' => 'fr'), true)); } /** @@ -452,16 +452,16 @@ class UrlGeneratorTest extends \PHPUnit_Framework_TestCase $routes = $this->getRoutes('test', new Route('/{name}', array(), array('_scheme' => 'http'), array(), '{locale}.example.com')); $this->assertSame('//fr.example.com/app.php/Fabien', $this->getGenerator($routes)->generate('test', - array('name' =>'Fabien', 'locale' => 'fr'), UrlGeneratorInterface::NETWORK_PATH), 'network path with different host' + array('name' => 'Fabien', 'locale' => 'fr'), UrlGeneratorInterface::NETWORK_PATH), 'network path with different host' ); $this->assertSame('//fr.example.com/app.php/Fabien?query=string', $this->getGenerator($routes, array('host' => 'fr.example.com'))->generate('test', - array('name' =>'Fabien', 'locale' => 'fr', 'query' => 'string'), UrlGeneratorInterface::NETWORK_PATH), 'network path although host same as context' + array('name' => 'Fabien', 'locale' => 'fr', 'query' => 'string'), UrlGeneratorInterface::NETWORK_PATH), 'network path although host same as context' ); $this->assertSame('http://fr.example.com/app.php/Fabien', $this->getGenerator($routes, array('scheme' => 'https'))->generate('test', - array('name' =>'Fabien', 'locale' => 'fr'), UrlGeneratorInterface::NETWORK_PATH), 'absolute URL because scheme requirement does not match context' + array('name' => 'Fabien', 'locale' => 'fr'), UrlGeneratorInterface::NETWORK_PATH), 'absolute URL because scheme requirement does not match context' ); $this->assertSame('http://fr.example.com/app.php/Fabien', $this->getGenerator($routes)->generate('test', - array('name' =>'Fabien', 'locale' => 'fr'), UrlGeneratorInterface::ABSOLUTE_URL), 'absolute URL with same scheme because it is requested' + array('name' => 'Fabien', 'locale' => 'fr'), UrlGeneratorInterface::ABSOLUTE_URL), 'absolute URL with same scheme because it is requested' ); } @@ -477,22 +477,22 @@ class UrlGeneratorTest extends \PHPUnit_Framework_TestCase $generator = $this->getGenerator($routes, array('host' => 'example.com', 'pathInfo' => '/fabien/symfony-is-great/')); $this->assertSame('comments', $generator->generate('comments', - array('author' =>'fabien', 'article' => 'symfony-is-great'), UrlGeneratorInterface::RELATIVE_PATH) + array('author' => 'fabien', 'article' => 'symfony-is-great'), UrlGeneratorInterface::RELATIVE_PATH) ); $this->assertSame('comments?page=2', $generator->generate('comments', - array('author' =>'fabien', 'article' => 'symfony-is-great', 'page' => 2), UrlGeneratorInterface::RELATIVE_PATH) + array('author' => 'fabien', 'article' => 'symfony-is-great', 'page' => 2), UrlGeneratorInterface::RELATIVE_PATH) ); $this->assertSame('../twig-is-great/', $generator->generate('article', - array('author' =>'fabien', 'article' => 'twig-is-great'), UrlGeneratorInterface::RELATIVE_PATH) + array('author' => 'fabien', 'article' => 'twig-is-great'), UrlGeneratorInterface::RELATIVE_PATH) ); $this->assertSame('../../bernhard/forms-are-great/', $generator->generate('article', - array('author' =>'bernhard', 'article' => 'forms-are-great'), UrlGeneratorInterface::RELATIVE_PATH) + array('author' => 'bernhard', 'article' => 'forms-are-great'), UrlGeneratorInterface::RELATIVE_PATH) ); $this->assertSame('//bernhard.example.com/app.php/forms-are-great', $generator->generate('host', - array('author' =>'bernhard', 'article' => 'forms-are-great'), UrlGeneratorInterface::RELATIVE_PATH) + array('author' => 'bernhard', 'article' => 'forms-are-great'), UrlGeneratorInterface::RELATIVE_PATH) ); $this->assertSame('https://example.com/app.php/bernhard', $generator->generate('scheme', - array('author' =>'bernhard'), UrlGeneratorInterface::RELATIVE_PATH) + array('author' => 'bernhard'), UrlGeneratorInterface::RELATIVE_PATH) ); $this->assertSame('../../about', $generator->generate('unrelated', array(), UrlGeneratorInterface::RELATIVE_PATH) @@ -513,102 +513,102 @@ class UrlGeneratorTest extends \PHPUnit_Framework_TestCase array( '/same/dir/', '/same/dir/', - '' + '', ), array( '/same/file', '/same/file', - '' + '', ), array( '/', '/file', - 'file' + 'file', ), array( '/', '/dir/file', - 'dir/file' + 'dir/file', ), array( '/dir/file.html', '/dir/different-file.html', - 'different-file.html' + 'different-file.html', ), array( '/same/dir/extra-file', '/same/dir/', - './' + './', ), array( '/parent/dir/', '/parent/', - '../' + '../', ), array( '/parent/dir/extra-file', '/parent/', - '../' + '../', ), array( '/a/b/', '/x/y/z/', - '../../x/y/z/' + '../../x/y/z/', ), array( '/a/b/c/d/e', '/a/c/d', - '../../../c/d' + '../../../c/d', ), array( '/a/b/c//', '/a/b/c/', - '../' + '../', ), array( '/a/b/c/', '/a/b/c//', - './/' + './/', ), array( '/root/a/b/c/', '/root/x/b/c/', - '../../../x/b/c/' + '../../../x/b/c/', ), array( '/a/b/c/d/', '/a', - '../../../../a' + '../../../../a', ), array( '/special-chars/sp%20ce/1€/mäh/e=mc²', '/special-chars/sp%20ce/1€/<µ>/e=mc²', - '../<µ>/e=mc²' + '../<µ>/e=mc²', ), array( 'not-rooted', 'dir/file', - 'dir/file' + 'dir/file', ), array( '//dir/', '', - '../../' + '../../', ), array( '/dir/', '/dir/file:with-colon', - './file:with-colon' + './file:with-colon', ), array( '/dir/', '/dir/subdir/file:with-colon', - 'subdir/file:with-colon' + 'subdir/file:with-colon', ), array( '/dir/', '/dir/:subdir/', - './:subdir/' + './:subdir/', ), ); } diff --git a/src/Symfony/Component/Routing/Tests/Loader/AnnotationClassLoaderTest.php b/src/Symfony/Component/Routing/Tests/Loader/AnnotationClassLoaderTest.php index 5b7325c317..a8ebc3281d 100644 --- a/src/Symfony/Component/Routing/Tests/Loader/AnnotationClassLoaderTest.php +++ b/src/Symfony/Component/Routing/Tests/Loader/AnnotationClassLoaderTest.php @@ -74,17 +74,17 @@ class AnnotationClassLoaderTest extends AbstractAnnotationLoaderTest array( 'Symfony\Component\Routing\Tests\Fixtures\AnnotatedClasses\BarClass', array('name' => 'route1'), - array('arg2' => 'defaultValue2', 'arg3' => 'defaultValue3') + array('arg2' => 'defaultValue2', 'arg3' => 'defaultValue3'), ), array( 'Symfony\Component\Routing\Tests\Fixtures\AnnotatedClasses\BarClass', array('name' => 'route1', 'defaults' => array('arg2' => 'foo')), - array('arg2' => 'defaultValue2', 'arg3' => 'defaultValue3') + array('arg2' => 'defaultValue2', 'arg3' => 'defaultValue3'), ), array( 'Symfony\Component\Routing\Tests\Fixtures\AnnotatedClasses\BarClass', array('name' => 'route1', 'defaults' => array('arg2' => 'foobar')), - array('arg2' => false, 'arg3' => 'defaultValue3') + array('arg2' => false, 'arg3' => 'defaultValue3'), ), ); } diff --git a/src/Symfony/Component/Routing/Tests/Matcher/ApacheUrlMatcherTest.php b/src/Symfony/Component/Routing/Tests/Matcher/ApacheUrlMatcherTest.php index 38127a09f6..05e6261a5f 100644 --- a/src/Symfony/Component/Routing/Tests/Matcher/ApacheUrlMatcherTest.php +++ b/src/Symfony/Component/Routing/Tests/Matcher/ApacheUrlMatcherTest.php @@ -103,7 +103,7 @@ class ApacheUrlMatcherTest extends \PHPUnit_Framework_TestCase 'ignoreAttributes' => array('attr_a', 'attr_b'), '_controller' => 'FrameworkBundle:Redirect:redirect', '_route' => 'product_view', - ) + ), ), array( 'REDIRECT_ envs', @@ -146,7 +146,7 @@ class ApacheUrlMatcherTest extends \PHPUnit_Framework_TestCase 'name' => 'world', '_route' => 'hello', ), - ) + ), ); } } diff --git a/src/Symfony/Component/Routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php b/src/Symfony/Component/Routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php index 542ede85c0..1b2dee688d 100644 --- a/src/Symfony/Component/Routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php +++ b/src/Symfony/Component/Routing/Tests/Matcher/Dumper/PhpMatcherDumperTest.php @@ -255,7 +255,7 @@ class PhpMatcherDumperTest extends \PHPUnit_Framework_TestCase return array( array($collection, 'url_matcher1.php', array()), array($redirectCollection, 'url_matcher2.php', array('base_class' => 'Symfony\Component\Routing\Tests\Fixtures\RedirectableUrlMatcher')), - array($rootprefixCollection, 'url_matcher3.php', array()) + array($rootprefixCollection, 'url_matcher3.php', array()), ); } } diff --git a/src/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php b/src/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php index 8a1428f170..e8056e8c22 100644 --- a/src/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php +++ b/src/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php @@ -78,7 +78,8 @@ class UrlMatcherTest extends \PHPUnit_Framework_TestCase try { $matcher->match('/no-match'); $this->fail(); - } catch (ResourceNotFoundException $e) {} + } catch (ResourceNotFoundException $e) { + } $this->assertEquals(array('_route' => 'foo', 'bar' => 'baz'), $matcher->match('/foo/baz')); // test that defaults are merged @@ -98,7 +99,8 @@ class UrlMatcherTest extends \PHPUnit_Framework_TestCase try { $matcher->match('/foo'); $this->fail(); - } catch (MethodNotAllowedException $e) {} + } catch (MethodNotAllowedException $e) { + } // route does match with GET or HEAD method context $matcher = new UrlMatcher($collection, new RequestContext()); diff --git a/src/Symfony/Component/Routing/Tests/RouteCompilerTest.php b/src/Symfony/Component/Routing/Tests/RouteCompilerTest.php index d663ae960b..ef26c87161 100644 --- a/src/Symfony/Component/Routing/Tests/RouteCompilerTest.php +++ b/src/Symfony/Component/Routing/Tests/RouteCompilerTest.php @@ -38,7 +38,7 @@ class RouteCompilerTest extends \PHPUnit_Framework_TestCase array('/foo'), '/foo', '#^/foo$#s', array(), array( array('text', '/foo'), - )), + ),), array( 'Route with a variable', @@ -46,7 +46,7 @@ class RouteCompilerTest extends \PHPUnit_Framework_TestCase '/foo', '#^/foo/(?P[^/]++)$#s', array('bar'), array( array('variable', '/', '[^/]++', 'bar'), array('text', '/foo'), - )), + ),), array( 'Route with a variable that has a default value', @@ -54,7 +54,7 @@ class RouteCompilerTest extends \PHPUnit_Framework_TestCase '/foo', '#^/foo(?:/(?P[^/]++))?$#s', array('bar'), array( array('variable', '/', '[^/]++', 'bar'), array('text', '/foo'), - )), + ),), array( 'Route with several variables', @@ -63,7 +63,7 @@ class RouteCompilerTest extends \PHPUnit_Framework_TestCase array('variable', '/', '[^/]++', 'foobar'), array('variable', '/', '[^/]++', 'bar'), array('text', '/foo'), - )), + ),), array( 'Route with several variables that have default values', @@ -72,7 +72,7 @@ class RouteCompilerTest extends \PHPUnit_Framework_TestCase array('variable', '/', '[^/]++', 'foobar'), array('variable', '/', '[^/]++', 'bar'), array('text', '/foo'), - )), + ),), array( 'Route with several variables but some of them have no default values', @@ -81,28 +81,28 @@ class RouteCompilerTest extends \PHPUnit_Framework_TestCase array('variable', '/', '[^/]++', 'foobar'), array('variable', '/', '[^/]++', 'bar'), array('text', '/foo'), - )), + ),), array( 'Route with an optional variable as the first segment', array('/{bar}', array('bar' => 'bar')), '', '#^/(?P[^/]++)?$#s', array('bar'), array( array('variable', '/', '[^/]++', 'bar'), - )), + ),), array( 'Route with a requirement of 0', array('/{bar}', array('bar' => null), array('bar' => '0')), '', '#^/(?P0)?$#s', array('bar'), array( array('variable', '/', '0', 'bar'), - )), + ),), array( 'Route with an optional variable as the first segment with requirements', array('/{bar}', array('bar' => 'bar'), array('bar' => '(foo|bar)')), '', '#^/(?P(foo|bar))?$#s', array('bar'), array( array('variable', '/', '(foo|bar)', 'bar'), - )), + ),), array( 'Route with only optional variables', @@ -110,7 +110,7 @@ class RouteCompilerTest extends \PHPUnit_Framework_TestCase '', '#^/(?P[^/]++)?(?:/(?P[^/]++))?$#s', array('foo', 'bar'), array( array('variable', '/', '[^/]++', 'bar'), array('variable', '/', '[^/]++', 'foo'), - )), + ),), array( 'Route with a variable in last position', @@ -118,7 +118,7 @@ class RouteCompilerTest extends \PHPUnit_Framework_TestCase '/foo', '#^/foo\-(?P[^/]++)$#s', array('bar'), array( array('variable', '-', '[^/]++', 'bar'), array('text', '/foo'), - )), + ),), array( 'Route with nested placeholders', @@ -127,7 +127,7 @@ class RouteCompilerTest extends \PHPUnit_Framework_TestCase array('text', 'static}'), array('variable', '', '[^/]+', 'var'), array('text', '/{static'), - )), + ),), array( 'Route without separator between variables', @@ -138,7 +138,7 @@ class RouteCompilerTest extends \PHPUnit_Framework_TestCase array('variable', '', '(y|Y)', 'y'), array('variable', '', '[^/\.]+', 'x'), array('variable', '/', '[^/\.]+', 'w'), - )), + ),), array( 'Route with a format', @@ -147,7 +147,7 @@ class RouteCompilerTest extends \PHPUnit_Framework_TestCase array('variable', '.', '[^/]++', '_format'), array('variable', '/', '[^/\.]++', 'bar'), array('text', '/foo'), - )), + ),), ); } @@ -167,7 +167,7 @@ class RouteCompilerTest extends \PHPUnit_Framework_TestCase */ public function testRouteWithNumericVariableName($name) { - $route = new Route('/{'. $name.'}'); + $route = new Route('/{'.$name.'}'); $route->compile(); } @@ -176,7 +176,7 @@ class RouteCompilerTest extends \PHPUnit_Framework_TestCase return array( array('09'), array('123'), - array('1e2') + array('1e2'), ); } diff --git a/src/Symfony/Component/Routing/Tests/RouteTest.php b/src/Symfony/Component/Routing/Tests/RouteTest.php index 9f496e259e..a7a4181559 100644 --- a/src/Symfony/Component/Routing/Tests/RouteTest.php +++ b/src/Symfony/Component/Routing/Tests/RouteTest.php @@ -137,7 +137,7 @@ class RouteTest extends \PHPUnit_Framework_TestCase array(array()), array('^$'), array('^'), - array('$') + array('$'), ); } diff --git a/src/Symfony/Component/Routing/Tests/RouterTest.php b/src/Symfony/Component/Routing/Tests/RouterTest.php index a3c336e5b7..e96c95ab78 100644 --- a/src/Symfony/Component/Routing/Tests/RouterTest.php +++ b/src/Symfony/Component/Routing/Tests/RouterTest.php @@ -30,7 +30,7 @@ class RouterTest extends \PHPUnit_Framework_TestCase $this->router->setOptions(array( 'cache_dir' => './cache', 'debug' => true, - 'resource_type' => 'ResourceType' + 'resource_type' => 'ResourceType', )); $this->assertSame('./cache', $this->router->getOption('cache_dir')); @@ -48,7 +48,7 @@ class RouterTest extends \PHPUnit_Framework_TestCase 'cache_dir' => './cache', 'option_foo' => true, 'option_bar' => 'baz', - 'resource_type' => 'ResourceType' + 'resource_type' => 'ResourceType', )); } @@ -102,14 +102,13 @@ class RouterTest extends \PHPUnit_Framework_TestCase ->will($this->returnValue($this->getMock('Symfony\Component\Routing\RouteCollection'))); $this->assertInstanceOf('Symfony\\Component\\Routing\\Matcher\\UrlMatcher', $this->router->getMatcher()); - } public function provideMatcherOptionsPreventingCaching() { return array( array('cache_dir'), - array('matcher_cache_class') + array('matcher_cache_class'), ); } @@ -125,14 +124,13 @@ class RouterTest extends \PHPUnit_Framework_TestCase ->will($this->returnValue($this->getMock('Symfony\Component\Routing\RouteCollection'))); $this->assertInstanceOf('Symfony\\Component\\Routing\\Generator\\UrlGenerator', $this->router->getGenerator()); - } public function provideGeneratorOptionsPreventingCaching() { return array( array('cache_dir'), - array('generator_cache_class') + array('generator_cache_class'), ); } } diff --git a/src/Symfony/Component/Security/Acl/Dbal/AclProvider.php b/src/Symfony/Component/Security/Acl/Dbal/AclProvider.php index c422c2d0a9..96b6a4b64b 100644 --- a/src/Symfony/Component/Security/Acl/Dbal/AclProvider.php +++ b/src/Symfony/Component/Security/Acl/Dbal/AclProvider.php @@ -104,7 +104,7 @@ class AclProvider implements AclProviderInterface $currentBatch = array(); $oidLookup = array(); - for ($i=0,$c=count($oids); $i<$c; $i++) { + for ($i = 0,$c = count($oids); $i<$c; $i++) { $oid = $oids[$i]; $oidLookupKey = $oid->getIdentifier().$oid->getType(); $oidLookup[$oidLookupKey] = $oid; @@ -500,8 +500,8 @@ QUERY; $acls = $aces = $emptyArray = array(); $oidCache = $oidLookup; $result = new \SplObjectStorage(); - $loadedAces =& $this->loadedAces; - $loadedAcls =& $this->loadedAcls; + $loadedAces = & $this->loadedAces; + $loadedAcls = & $this->loadedAcls; $permissionGrantingStrategy = $this->permissionGrantingStrategy; // we need these to set protected properties on hydrated objects @@ -593,7 +593,7 @@ QUERY; // It is important to only ever have one ACE instance per actual row since // some ACEs are shared between ACL instances if (!isset($loadedAces[$aceId])) { - if (!isset($sids[$key = ($username?'1':'0').$securityIdentifier])) { + if (!isset($sids[$key = ($username ? '1' : '0').$securityIdentifier])) { if ($username) { $sids[$key] = new UserSecurityIdentity( substr($securityIdentifier, 1 + $pos = strpos($securityIdentifier, '-')), diff --git a/src/Symfony/Component/Security/Acl/Dbal/MutableAclProvider.php b/src/Symfony/Component/Security/Acl/Dbal/MutableAclProvider.php index b8f5fb8e20..2a4eac0853 100644 --- a/src/Symfony/Component/Security/Acl/Dbal/MutableAclProvider.php +++ b/src/Symfony/Component/Security/Acl/Dbal/MutableAclProvider.php @@ -188,7 +188,7 @@ class MutableAclProvider extends AclProvider implements MutableAclProviderInterf $propertyChanges['aces'] = new \SplObjectStorage(); } - $acePropertyChanges = $propertyChanges['aces']->contains($ace)? $propertyChanges['aces']->offsetGet($ace) : array(); + $acePropertyChanges = $propertyChanges['aces']->contains($ace) ? $propertyChanges['aces']->offsetGet($ace) : array(); if (isset($acePropertyChanges[$propertyName])) { $oldValue = $acePropertyChanges[$propertyName][0]; @@ -448,8 +448,8 @@ QUERY; $query, $this->options['entry_table_name'], $classId, - null === $objectIdentityId? 'NULL' : intval($objectIdentityId), - null === $field? 'NULL' : $this->connection->quote($field), + null === $objectIdentityId ? 'NULL' : intval($objectIdentityId), + null === $field ? 'NULL' : $this->connection->quote($field), $aceOrder, $securityIdentityId, $mask, @@ -767,7 +767,7 @@ QUERY; $classIds = new \SplObjectStorage(); $currentIds = array(); foreach ($changes[1] as $field => $new) { - for ($i=0,$c=count($new); $i<$c; $i++) { + for ($i = 0,$c = count($new); $i<$c; $i++) { $ace = $new[$i]; if (null === $ace->getId()) { @@ -844,7 +844,7 @@ QUERY; $sids = new \SplObjectStorage(); $classIds = new \SplObjectStorage(); $currentIds = array(); - for ($i=0,$c=count($new); $i<$c; $i++) { + for ($i = 0,$c = count($new); $i<$c; $i++) { $ace = $new[$i]; if (null === $ace->getId()) { @@ -887,7 +887,7 @@ QUERY; list($old, $new) = $changes; $currentIds = array(); - for ($i=0,$c=count($new); $i<$c; $i++) { + for ($i = 0,$c = count($new); $i<$c; $i++) { $ace = $new[$i]; if (null !== $ace->getId()) { @@ -925,11 +925,11 @@ QUERY; if (isset($propertyChanges['aceOrder']) && $propertyChanges['aceOrder'][1] > $propertyChanges['aceOrder'][0] && $propertyChanges == $aces->offsetGet($ace)) { - $aces->next(); - if ($aces->valid()) { - $this->updateAce($aces, $aces->current()); - } + $aces->next(); + if ($aces->valid()) { + $this->updateAce($aces, $aces->current()); } + } if (isset($propertyChanges['mask'])) { $sets[] = sprintf('mask = %d', $propertyChanges['mask'][1]); @@ -949,5 +949,4 @@ QUERY; $this->connection->executeQuery($this->getUpdateAccessControlEntrySql($ace->getId(), $sets)); } - } diff --git a/src/Symfony/Component/Security/Acl/Domain/Acl.php b/src/Symfony/Component/Security/Acl/Domain/Acl.php index cd02751f95..f426f34a3b 100644 --- a/src/Symfony/Component/Security/Acl/Domain/Acl.php +++ b/src/Symfony/Component/Security/Acl/Domain/Acl.php @@ -125,7 +125,7 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged */ public function getClassFieldAces($field) { - return isset($this->classFieldAces[$field])? $this->classFieldAces[$field] : array(); + return isset($this->classFieldAces[$field]) ? $this->classFieldAces[$field] : array(); } /** @@ -403,7 +403,7 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged */ private function deleteAce($property, $index) { - $aces =& $this->$property; + $aces = & $this->$property; if (!isset($aces[$index])) { throw new \OutOfBoundsException(sprintf('The index "%d" does not exist.', $index)); } @@ -413,7 +413,7 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged $this->$property = array_values($this->$property); $this->onPropertyChanged($property, $oldValue, $this->$property); - for ($i=$index,$c=count($this->$property); $i<$c; $i++) { + for ($i = $index,$c = count($this->$property); $i<$c; $i++) { $this->onEntryPropertyChanged($aces[$i], 'aceOrder', $i+1, $i); } } @@ -428,7 +428,7 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged */ private function deleteFieldAce($property, $index, $field) { - $aces =& $this->$property; + $aces = & $this->$property; if (!isset($aces[$field][$index])) { throw new \OutOfBoundsException(sprintf('The index "%d" does not exist.', $index)); } @@ -438,7 +438,7 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged $aces[$field] = array_values($aces[$field]); $this->onPropertyChanged($property, $oldValue, $this->$property); - for ($i=$index,$c=count($aces[$field]); $i<$c; $i++) { + for ($i = $index,$c = count($aces[$field]); $i<$c; $i++) { $this->onEntryPropertyChanged($aces[$field][$i], 'aceOrder', $i+1, $i); } } @@ -473,7 +473,7 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged } } - $aces =& $this->$property; + $aces = & $this->$property; $oldValue = $this->$property; if (isset($aces[$index])) { $this->$property = array_merge( @@ -482,7 +482,7 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged array_slice($this->$property, $index) ); - for ($i=$index,$c=count($this->$property)-1; $i<$c; $i++) { + for ($i = $index,$c = count($this->$property)-1; $i<$c; $i++) { $this->onEntryPropertyChanged($aces[$i+1], 'aceOrder', $i, $i+1); } } @@ -522,7 +522,7 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged } } - $aces =& $this->$property; + $aces = & $this->$property; if (!isset($aces[$field])) { $aces[$field] = array(); } @@ -539,7 +539,7 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged array_slice($aces[$field], $index) ); - for ($i=$index,$c=count($aces[$field])-1; $i<$c; $i++) { + for ($i = $index,$c = count($aces[$field])-1; $i<$c; $i++) { $this->onEntryPropertyChanged($aces[$field][$i+1], 'aceOrder', $i, $i+1); } } @@ -559,7 +559,7 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged */ private function updateAce($property, $index, $mask, $strategy = null) { - $aces =& $this->$property; + $aces = & $this->$property; if (!isset($aces[$index])) { throw new \OutOfBoundsException(sprintf('The index "%d" does not exist.', $index)); } @@ -618,7 +618,7 @@ class Acl implements AuditableAclInterface, NotifyPropertyChanged throw new \InvalidArgumentException('$field cannot be empty.'); } - $aces =& $this->$property; + $aces = & $this->$property; if (!isset($aces[$field][$index])) { throw new \OutOfBoundsException(sprintf('The index "%d" does not exist.', $index)); } diff --git a/src/Symfony/Component/Security/Acl/Permission/MaskBuilder.php b/src/Symfony/Component/Security/Acl/Permission/MaskBuilder.php index 4d475fbce4..8ca25bcff5 100644 --- a/src/Symfony/Component/Security/Acl/Permission/MaskBuilder.php +++ b/src/Symfony/Component/Security/Acl/Permission/MaskBuilder.php @@ -128,7 +128,7 @@ class MaskBuilder $length = strlen($pattern); $bitmask = str_pad(decbin($this->mask), $length, '0', STR_PAD_LEFT); - for ($i=$length-1; $i>=0; $i--) { + for ($i = $length-1; $i >= 0; $i--) { if ('1' === $bitmask[$i]) { try { $pattern[$i] = self::getCode(1 << ($length - $i - 1)); diff --git a/src/Symfony/Component/Security/Acl/Voter/AclVoter.php b/src/Symfony/Component/Security/Acl/Voter/AclVoter.php index b21b1e675b..9657eedb8d 100644 --- a/src/Symfony/Component/Security/Acl/Voter/AclVoter.php +++ b/src/Symfony/Component/Security/Acl/Voter/AclVoter.php @@ -64,7 +64,7 @@ class AclVoter implements VoterInterface if (null === $object) { if (null !== $this->logger) { - $this->logger->debug(sprintf('Object identity unavailable. Voting to %s', $this->allowIfObjectIdentityUnavailable? 'grant access' : 'abstain')); + $this->logger->debug(sprintf('Object identity unavailable. Voting to %s', $this->allowIfObjectIdentityUnavailable ? 'grant access' : 'abstain')); } return $this->allowIfObjectIdentityUnavailable ? self::ACCESS_GRANTED : self::ACCESS_ABSTAIN; @@ -79,7 +79,7 @@ class AclVoter implements VoterInterface $oid = $object; } elseif (null === $oid = $this->objectIdentityRetrievalStrategy->getObjectIdentity($object)) { if (null !== $this->logger) { - $this->logger->debug(sprintf('Object identity unavailable. Voting to %s', $this->allowIfObjectIdentityUnavailable? 'grant access' : 'abstain')); + $this->logger->debug(sprintf('Object identity unavailable. Voting to %s', $this->allowIfObjectIdentityUnavailable ? 'grant access' : 'abstain')); } return $this->allowIfObjectIdentityUnavailable ? self::ACCESS_GRANTED : self::ACCESS_ABSTAIN; diff --git a/src/Symfony/Component/Security/Core/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php b/src/Symfony/Component/Security/Core/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php index 21ce8d0ac8..b1e6c3845a 100644 --- a/src/Symfony/Component/Security/Core/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php +++ b/src/Symfony/Component/Security/Core/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php @@ -56,9 +56,9 @@ class PreAuthenticatedAuthenticationProvider implements AuthenticationProviderIn return; } - if (!$user = $token->getUser()) { - throw new BadCredentialsException('No pre-authenticated principal found in request.'); - } + if (!$user = $token->getUser()) { + throw new BadCredentialsException('No pre-authenticated principal found in request.'); + } /* if (null === $token->getCredentials()) { throw new BadCredentialsException('No pre-authenticated credentials found in request.'); @@ -66,13 +66,13 @@ class PreAuthenticatedAuthenticationProvider implements AuthenticationProviderIn */ $user = $this->userProvider->loadUserByUsername($user); - $this->userChecker->checkPostAuth($user); + $this->userChecker->checkPostAuth($user); - $authenticatedToken = new PreAuthenticatedToken($user, $token->getCredentials(), $this->providerKey, $user->getRoles()); - $authenticatedToken->setAttributes($token->getAttributes()); + $authenticatedToken = new PreAuthenticatedToken($user, $token->getCredentials(), $this->providerKey, $user->getRoles()); + $authenticatedToken->setAttributes($token->getAttributes()); - return $authenticatedToken; - } + return $authenticatedToken; + } /** * {@inheritdoc} diff --git a/src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php b/src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php index 993960be9c..6813adf99d 100644 --- a/src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php +++ b/src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php @@ -154,7 +154,7 @@ abstract class AbstractToken implements TokenInterface is_object($this->user) ? clone $this->user : $this->user, $this->authenticated, $this->roles, - $this->attributes + $this->attributes, ) ); } diff --git a/src/Symfony/Component/Security/Core/Util/ClassUtils.php b/src/Symfony/Component/Security/Core/Util/ClassUtils.php index 26bf1a1264..1d40c8d4e2 100644 --- a/src/Symfony/Component/Security/Core/Util/ClassUtils.php +++ b/src/Symfony/Component/Security/Core/Util/ClassUtils.php @@ -39,7 +39,9 @@ class ClassUtils /** * This class should not be instantiated */ - private function __construct() {} + private function __construct() + { + } /** * Gets the real class name of a class name that could be a proxy. diff --git a/src/Symfony/Component/Security/Core/Util/StringUtils.php b/src/Symfony/Component/Security/Core/Util/StringUtils.php index acf8e9eed8..01441cb216 100644 --- a/src/Symfony/Component/Security/Core/Util/StringUtils.php +++ b/src/Symfony/Component/Security/Core/Util/StringUtils.php @@ -21,7 +21,9 @@ class StringUtils /** * This class should not be instantiated */ - private function __construct() {} + private function __construct() + { + } /** * Compares two strings. diff --git a/src/Symfony/Component/Security/Http/Authentication/DefaultAuthenticationFailureHandler.php b/src/Symfony/Component/Security/Http/Authentication/DefaultAuthenticationFailureHandler.php index f106a4afef..db96e67b56 100644 --- a/src/Symfony/Component/Security/Http/Authentication/DefaultAuthenticationFailureHandler.php +++ b/src/Symfony/Component/Security/Http/Authentication/DefaultAuthenticationFailureHandler.php @@ -53,7 +53,7 @@ class DefaultAuthenticationFailureHandler implements AuthenticationFailureHandle 'failure_path' => null, 'failure_forward' => false, 'login_path' => '/login', - 'failure_path_parameter' => '_failure_path' + 'failure_path_parameter' => '_failure_path', ), $options); } @@ -63,7 +63,7 @@ class DefaultAuthenticationFailureHandler implements AuthenticationFailureHandle public function onAuthenticationFailure(Request $request, AuthenticationException $exception) { if ($failureUrl = $request->get($this->options['failure_path_parameter'], null, true)) { - $this->options['failure_path'] = $failureUrl; + $this->options['failure_path'] = $failureUrl; } if (null === $this->options['failure_path']) { diff --git a/src/Symfony/Component/Security/Http/RememberMe/TokenBasedRememberMeServices.php b/src/Symfony/Component/Security/Http/RememberMe/TokenBasedRememberMeServices.php index db1b5081dc..7581a68eba 100644 --- a/src/Symfony/Component/Security/Http/RememberMe/TokenBasedRememberMeServices.php +++ b/src/Symfony/Component/Security/Http/RememberMe/TokenBasedRememberMeServices.php @@ -129,7 +129,7 @@ class TokenBasedRememberMeServices extends AbstractRememberMeServices $class, base64_encode($username), $expires, - $this->generateCookieHash($class, $username, $expires, $password) + $this->generateCookieHash($class, $username, $expires, $password), )); } diff --git a/src/Symfony/Component/Security/Tests/Acl/Dbal/AclProviderBenchmarkTest.php b/src/Symfony/Component/Security/Tests/Acl/Dbal/AclProviderBenchmarkTest.php index 8f6a30ceb7..e930b1977e 100644 --- a/src/Symfony/Component/Security/Tests/Acl/Dbal/AclProviderBenchmarkTest.php +++ b/src/Symfony/Component/Security/Tests/Acl/Dbal/AclProviderBenchmarkTest.php @@ -96,7 +96,7 @@ class AclProviderBenchmarkTest extends \PHPUnit_Framework_TestCase $this->insertEntryStmt = $this->con->prepare('INSERT INTO acl_entries (id, class_id, object_identity_id, field_name, ace_order, security_identity_id, mask, granting, granting_strategy, audit_success, audit_failure) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'); $this->insertOidAncestorStmt = $this->con->prepare('INSERT INTO acl_object_identity_ancestors (object_identity_id, ancestor_id) VALUES (?, ?)'); - for ($i=0; $i<40000; $i++) { + for ($i = 0; $i<40000; $i++) { $this->generateAclHierarchy(); } } @@ -111,7 +111,7 @@ class AclProviderBenchmarkTest extends \PHPUnit_Framework_TestCase protected function generateAclLevel($depth, $parentId, $ancestors) { $level = count($ancestors); - for ($i=0,$t=rand(1, 10); $i<$t; $i++) { + for ($i = 0,$t = rand(1, 10); $i<$t; $i++) { $id = $this->generateAcl($this->chooseClassId(), $parentId, $ancestors); if ($level < $depth) { @@ -165,7 +165,7 @@ class AclProviderBenchmarkTest extends \PHPUnit_Framework_TestCase $this->insertSidStmt->execute(array( $id, $this->getRandomString(rand(5, 30)), - rand(0, 1) + rand(0, 1), )); $id += 1; @@ -182,7 +182,7 @@ class AclProviderBenchmarkTest extends \PHPUnit_Framework_TestCase $sids = array(); $fieldOrder = array(); - for ($i=0; $i<=30; $i++) { + for ($i = 0; $i <= 30; $i++) { $fieldName = rand(0, 1) ? null : $this->getRandomString(rand(10, 20)); do { diff --git a/src/Symfony/Component/Security/Tests/Acl/Dbal/MutableAclProviderTest.php b/src/Symfony/Component/Security/Tests/Acl/Dbal/MutableAclProviderTest.php index 00a2228012..832a8960d0 100644 --- a/src/Symfony/Component/Security/Tests/Acl/Dbal/MutableAclProviderTest.php +++ b/src/Symfony/Component/Security/Tests/Acl/Dbal/MutableAclProviderTest.php @@ -88,7 +88,8 @@ class MutableAclProviderTest extends \PHPUnit_Framework_TestCase try { $provider->findAcl($oid); $this->fail('ACL has not been properly deleted.'); - } catch (AclNotFoundException $notFound) { } + } catch (AclNotFoundException $notFound) { + } } public function testDeleteAclDeletesChildren() @@ -103,7 +104,8 @@ class MutableAclProviderTest extends \PHPUnit_Framework_TestCase try { $provider->findAcl(new ObjectIdentity(1, 'Foo')); $this->fail('Child-ACLs have not been deleted.'); - } catch (AclNotFoundException $notFound) { } + } catch (AclNotFoundException $notFound) { + } } public function testFindAclsAddsPropertyListener() @@ -148,7 +150,7 @@ class MutableAclProviderTest extends \PHPUnit_Framework_TestCase 'parent' => array( 'object_identifier' => '1', 'class_type' => 'anotherFoo', - ) + ), )); $propertyChanges = $this->getField($provider, 'propertyChanges'); @@ -288,7 +290,8 @@ class MutableAclProviderTest extends \PHPUnit_Framework_TestCase try { $provider->updateAcl($acl1); $this->fail('Provider failed to detect a concurrent modification.'); - } catch (ConcurrentModificationException $ex) { } + } catch (ConcurrentModificationException $ex) { + } } public function testUpdateAcl() diff --git a/src/Symfony/Component/Security/Tests/Acl/Domain/AclTest.php b/src/Symfony/Component/Security/Tests/Acl/Domain/AclTest.php index 4b67e625e3..29acc3a254 100644 --- a/src/Symfony/Component/Security/Tests/Acl/Domain/AclTest.php +++ b/src/Symfony/Component/Security/Tests/Acl/Domain/AclTest.php @@ -128,7 +128,7 @@ class AclTest extends \PHPUnit_Framework_TestCase $acl = $this->getAcl(); $listener = $this->getListener(array( - $property, 'aceOrder', $property, 'aceOrder', $property + $property, 'aceOrder', $property, 'aceOrder', $property, )); $acl->addPropertyChangedListener($listener); @@ -358,7 +358,7 @@ class AclTest extends \PHPUnit_Framework_TestCase $acl->{'insert'.$type}('foo', new UserSecurityIdentity('foo', 'Foo'), 1); $listener = $this->getListener(array( - 'mask', 'mask', 'strategy' + 'mask', 'mask', 'strategy', )); $acl->addPropertyChangedListener($listener); diff --git a/src/Symfony/Component/Security/Tests/Acl/Domain/AuditLoggerTest.php b/src/Symfony/Component/Security/Tests/Acl/Domain/AuditLoggerTest.php index a0f38eb42c..c8522b49de 100644 --- a/src/Symfony/Component/Security/Tests/Acl/Domain/AuditLoggerTest.php +++ b/src/Symfony/Component/Security/Tests/Acl/Domain/AuditLoggerTest.php @@ -28,7 +28,7 @@ class AuditLoggerTest extends \PHPUnit_Framework_TestCase ->will($this->returnValue($audit)) ; - $ace + $ace ->expects($this->never()) ->method('isAuditFailure') ; diff --git a/src/Symfony/Component/Security/Tests/Acl/Domain/PermissionGrantingStrategyTest.php b/src/Symfony/Component/Security/Tests/Acl/Domain/PermissionGrantingStrategyTest.php index d200d2b0eb..4698a72583 100644 --- a/src/Symfony/Component/Security/Tests/Acl/Domain/PermissionGrantingStrategyTest.php +++ b/src/Symfony/Component/Security/Tests/Acl/Domain/PermissionGrantingStrategyTest.php @@ -154,7 +154,8 @@ class PermissionGrantingStrategyTest extends \PHPUnit_Framework_TestCase try { $strategy->isGranted($acl, array($requiredMask), array($sid)); $this->fail('The ACE is not supposed to match.'); - } catch (NoAceFoundException $noAce) { } + } catch (NoAceFoundException $noAce) { + } } else { $this->assertTrue($strategy->isGranted($acl, array($requiredMask), array($sid))); } diff --git a/src/Symfony/Component/Security/Tests/Acl/Domain/SecurityIdentityRetrievalStrategyTest.php b/src/Symfony/Component/Security/Tests/Acl/Domain/SecurityIdentityRetrievalStrategyTest.php index f649653db0..e5fb4ed9eb 100644 --- a/src/Symfony/Component/Security/Tests/Acl/Domain/SecurityIdentityRetrievalStrategyTest.php +++ b/src/Symfony/Component/Security/Tests/Acl/Domain/SecurityIdentityRetrievalStrategyTest.php @@ -103,7 +103,7 @@ class SecurityIdentityRetrievalStrategyTest extends \PHPUnit_Framework_TestCase array('guest', array('ROLE_FOO'), 'anonymous', array( new RoleSecurityIdentity('ROLE_FOO'), new RoleSecurityIdentity('IS_AUTHENTICATED_ANONYMOUSLY'), - )) + )), ); } diff --git a/src/Symfony/Component/Security/Tests/Core/Authentication/Token/AbstractTokenTest.php b/src/Symfony/Component/Security/Tests/Core/Authentication/Token/AbstractTokenTest.php index 5683b782cb..b8be6288dc 100644 --- a/src/Symfony/Component/Security/Tests/Core/Authentication/Token/AbstractTokenTest.php +++ b/src/Symfony/Component/Security/Tests/Core/Authentication/Token/AbstractTokenTest.php @@ -52,7 +52,9 @@ class ConcreteToken extends AbstractToken parent::unserialize($parentStr); } - public function getCredentials() {} + public function getCredentials() + { + } } class AbstractTokenTest extends \PHPUnit_Framework_TestCase @@ -227,13 +229,13 @@ class AbstractTokenTest extends \PHPUnit_Framework_TestCase 'foo', $user, ), array( - 'foo', $advancedUser + 'foo', $advancedUser, ), array( - $user, 'foo' + $user, 'foo', ), array( - $advancedUser, 'foo' + $advancedUser, 'foo', ), array( $user, new TestUser('foo'), @@ -254,10 +256,10 @@ class AbstractTokenTest extends \PHPUnit_Framework_TestCase new TestUser('foo'), $advancedUser, ), array( - $user, $advancedUser + $user, $advancedUser, ), array( - $advancedUser, $user + $advancedUser, $user, ), ); } diff --git a/src/Symfony/Component/Security/Tests/Core/Authorization/AccessDecisionManagerTest.php b/src/Symfony/Component/Security/Tests/Core/Authorization/AccessDecisionManagerTest.php index 0300cb4254..37e12b7e28 100644 --- a/src/Symfony/Component/Security/Tests/Core/Authorization/AccessDecisionManagerTest.php +++ b/src/Symfony/Component/Security/Tests/Core/Authorization/AccessDecisionManagerTest.php @@ -85,7 +85,7 @@ class AccessDecisionManagerTest extends \PHPUnit_Framework_TestCase array($token, 'consensus', $this->getVoter(VoterInterface::ACCESS_DENIED), false), array($token, 'consensus', $this->getVoter(VoterInterface::ACCESS_GRANTED), true), - + array($token, 'unanimous', $this->getVoterFor2Roles($token, VoterInterface::ACCESS_DENIED, VoterInterface::ACCESS_DENIED), false), array($token, 'unanimous', $this->getVoterFor2Roles($token, VoterInterface::ACCESS_DENIED, VoterInterface::ACCESS_GRANTED), false), array($token, 'unanimous', $this->getVoterFor2Roles($token, VoterInterface::ACCESS_GRANTED, VoterInterface::ACCESS_DENIED), false), @@ -164,7 +164,6 @@ class AccessDecisionManagerTest extends \PHPUnit_Framework_TestCase $voter->expects($this->any()) ->method('vote') ->will($this->returnValue($vote)); - ; return $voter; } @@ -175,7 +174,6 @@ class AccessDecisionManagerTest extends \PHPUnit_Framework_TestCase $voter->expects($this->any()) ->method('supportsClass') ->will($this->returnValue($ret)); - ; return $voter; } @@ -186,7 +184,6 @@ class AccessDecisionManagerTest extends \PHPUnit_Framework_TestCase $voter->expects($this->any()) ->method('supportsAttribute') ->will($this->returnValue($ret)); - ; return $voter; } diff --git a/src/Symfony/Component/Security/Tests/Core/Authorization/Voter/RoleVoterTest.php b/src/Symfony/Component/Security/Tests/Core/Authorization/Voter/RoleVoterTest.php index 63608ebb3b..8a5cdc5e59 100644 --- a/src/Symfony/Component/Security/Tests/Core/Authorization/Voter/RoleVoterTest.php +++ b/src/Symfony/Component/Security/Tests/Core/Authorization/Voter/RoleVoterTest.php @@ -55,7 +55,6 @@ class RoleVoterTest extends \PHPUnit_Framework_TestCase $token->expects($this->once()) ->method('getRoles') ->will($this->returnValue($roles)); - ; return $token; } diff --git a/src/Symfony/Component/Security/Tests/Core/Encoder/EncoderFactoryTest.php b/src/Symfony/Component/Security/Tests/Core/Encoder/EncoderFactoryTest.php index 2e55a4b6f8..85d4e91356 100644 --- a/src/Symfony/Component/Security/Tests/Core/Encoder/EncoderFactoryTest.php +++ b/src/Symfony/Component/Security/Tests/Core/Encoder/EncoderFactoryTest.php @@ -82,11 +82,21 @@ class EncoderFactoryTest extends \PHPUnit_Framework_TestCase class SomeUser implements UserInterface { - public function getRoles() {} - public function getPassword() {} - public function getSalt() {} - public function getUsername() {} - public function eraseCredentials() {} + public function getRoles() + { + } + public function getPassword() + { + } + public function getSalt() + { + } + public function getUsername() + { + } + public function eraseCredentials() + { + } } class SomeChildUser extends SomeUser diff --git a/src/Symfony/Component/Security/Tests/Http/Authentication/DefaultAuthenticationSuccessHandlerTest.php b/src/Symfony/Component/Security/Tests/Http/Authentication/DefaultAuthenticationSuccessHandlerTest.php index e6bc6ca512..aa5902bdf3 100644 --- a/src/Symfony/Component/Security/Tests/Http/Authentication/DefaultAuthenticationSuccessHandlerTest.php +++ b/src/Symfony/Component/Security/Tests/Http/Authentication/DefaultAuthenticationSuccessHandlerTest.php @@ -47,7 +47,7 @@ class DefaultAuthenticationSuccessHandlerTest extends \PHPUnit_Framework_TestCas { $options = array( 'always_use_default_target_path' => true, - 'default_target_path' => '/dashboard' + 'default_target_path' => '/dashboard', ); $response = $this->expectRedirectResponse('/dashboard'); diff --git a/src/Symfony/Component/Security/Tests/Http/EntryPoint/RetryAuthenticationEntryPointTest.php b/src/Symfony/Component/Security/Tests/Http/EntryPoint/RetryAuthenticationEntryPointTest.php index 91de1ca7fd..95c73d2404 100644 --- a/src/Symfony/Component/Security/Tests/Http/EntryPoint/RetryAuthenticationEntryPointTest.php +++ b/src/Symfony/Component/Security/Tests/Http/EntryPoint/RetryAuthenticationEntryPointTest.php @@ -46,26 +46,26 @@ class RetryAuthenticationEntryPointTest extends \PHPUnit_Framework_TestCase 80, 443, Request::create('http://localhost/foo/bar?baz=bat'), - 'https://localhost/foo/bar?baz=bat' + 'https://localhost/foo/bar?baz=bat', ), array( 80, 443, Request::create('https://localhost/foo/bar?baz=bat'), - 'http://localhost/foo/bar?baz=bat' + 'http://localhost/foo/bar?baz=bat', ), array( 80, 123, Request::create('http://localhost/foo/bar?baz=bat'), - 'https://localhost:123/foo/bar?baz=bat' + 'https://localhost:123/foo/bar?baz=bat', ), array( 8080, 443, Request::create('https://localhost/foo/bar?baz=bat'), - 'http://localhost:8080/foo/bar?baz=bat' - ) + 'http://localhost:8080/foo/bar?baz=bat', + ), ); } } diff --git a/src/Symfony/Component/Security/Tests/Http/Firewall/AbstractPreAuthenticatedListenerTest.php b/src/Symfony/Component/Security/Tests/Http/Firewall/AbstractPreAuthenticatedListenerTest.php index 76721ec955..34263bc6a3 100644 --- a/src/Symfony/Component/Security/Tests/Http/Firewall/AbstractPreAuthenticatedListenerTest.php +++ b/src/Symfony/Component/Security/Tests/Http/Firewall/AbstractPreAuthenticatedListenerTest.php @@ -64,7 +64,7 @@ class AbstractPreAuthenticatedListenerTest extends \PHPUnit_Framework_TestCase $listener = $this->getMockForAbstractClass('Symfony\Component\Security\Http\Firewall\AbstractPreAuthenticatedListener', array( $context, $authenticationManager, - 'TheProviderKey' + 'TheProviderKey', )); $listener ->expects($this->once()) @@ -110,7 +110,7 @@ class AbstractPreAuthenticatedListenerTest extends \PHPUnit_Framework_TestCase $listener = $this->getMockForAbstractClass('Symfony\Component\Security\Http\Firewall\AbstractPreAuthenticatedListener', array( $context, $authenticationManager, - 'TheProviderKey' + 'TheProviderKey', )); $listener ->expects($this->once()) @@ -158,7 +158,7 @@ class AbstractPreAuthenticatedListenerTest extends \PHPUnit_Framework_TestCase $listener = $this->getMockForAbstractClass('Symfony\Component\Security\Http\Firewall\AbstractPreAuthenticatedListener', array( $context, $authenticationManager, - 'TheProviderKey' + 'TheProviderKey', )); $listener ->expects($this->once()) @@ -199,7 +199,7 @@ class AbstractPreAuthenticatedListenerTest extends \PHPUnit_Framework_TestCase $listener = $this->getMockForAbstractClass('Symfony\Component\Security\Http\Firewall\AbstractPreAuthenticatedListener', array( $context, $authenticationManager, - 'TheProviderKey' + 'TheProviderKey', )); $listener ->expects($this->once()) @@ -248,7 +248,7 @@ class AbstractPreAuthenticatedListenerTest extends \PHPUnit_Framework_TestCase $listener = $this->getMockForAbstractClass('Symfony\Component\Security\Http\Firewall\AbstractPreAuthenticatedListener', array( $context, $authenticationManager, - 'TheProviderKey' + 'TheProviderKey', )); $listener ->expects($this->once()) diff --git a/src/Symfony/Component/Security/Tests/Http/Firewall/BasicAuthenticationListenerTest.php b/src/Symfony/Component/Security/Tests/Http/Firewall/BasicAuthenticationListenerTest.php index 7616149015..b345178c33 100644 --- a/src/Symfony/Component/Security/Tests/Http/Firewall/BasicAuthenticationListenerTest.php +++ b/src/Symfony/Component/Security/Tests/Http/Firewall/BasicAuthenticationListenerTest.php @@ -39,7 +39,7 @@ class BasicAuthenticationListenerTest extends \PHPUnit_Framework_TestCase { $request = new Request(array(), array(), array(), array(), array(), array( 'PHP_AUTH_USER' => 'TheUsername', - 'PHP_AUTH_PW' => 'ThePassword' + 'PHP_AUTH_PW' => 'ThePassword', )); $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); @@ -85,7 +85,7 @@ class BasicAuthenticationListenerTest extends \PHPUnit_Framework_TestCase { $request = new Request(array(), array(), array(), array(), array(), array( 'PHP_AUTH_USER' => 'TheUsername', - 'PHP_AUTH_PW' => 'ThePassword' + 'PHP_AUTH_PW' => 'ThePassword', )); $token = $this->getMock('Symfony\Component\Security\Core\Authentication\Token\TokenInterface'); @@ -214,7 +214,7 @@ class BasicAuthenticationListenerTest extends \PHPUnit_Framework_TestCase { $request = new Request(array(), array(), array(), array(), array(), array( 'PHP_AUTH_USER' => 'TheUsername', - 'PHP_AUTH_PW' => 'ThePassword' + 'PHP_AUTH_PW' => 'ThePassword', )); $token = new PreAuthenticatedToken('TheUser', 'TheCredentials', 'TheProviderKey', array('ROLE_FOO')); diff --git a/src/Symfony/Component/Security/Tests/Http/Firewall/ContextListenerTest.php b/src/Symfony/Component/Security/Tests/Http/Firewall/ContextListenerTest.php index 336c3334fe..1429f26b81 100644 --- a/src/Symfony/Component/Security/Tests/Http/Firewall/ContextListenerTest.php +++ b/src/Symfony/Component/Security/Tests/Http/Firewall/ContextListenerTest.php @@ -186,7 +186,7 @@ class ContextListenerTest extends \PHPUnit_Framework_TestCase return array( array(serialize(new \__PHP_Incomplete_Class())), array(serialize(null)), - array(null) + array(null), ); } diff --git a/src/Symfony/Component/Security/Tests/Http/Firewall/DigestDataTest.php b/src/Symfony/Component/Security/Tests/Http/Firewall/DigestDataTest.php index 8b63d9c953..e5be6f8802 100644 --- a/src/Symfony/Component/Security/Tests/Http/Firewall/DigestDataTest.php +++ b/src/Symfony/Component/Security/Tests/Http/Firewall/DigestDataTest.php @@ -18,9 +18,9 @@ class DigestDataTest extends \PHPUnit_Framework_TestCase public function testGetResponse() { $digestAuth = new DigestData( - 'username="user", realm="Welcome, robot!", ' . - 'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", ' . - 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", ' . + 'username="user", realm="Welcome, robot!", '. + 'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", '. + 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", '. 'response="b52938fc9e6d7c01be7702ece9031b42"' ); @@ -30,9 +30,9 @@ class DigestDataTest extends \PHPUnit_Framework_TestCase public function testGetUsername() { $digestAuth = new DigestData( - 'username="user", realm="Welcome, robot!", ' . - 'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", ' . - 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", ' . + 'username="user", realm="Welcome, robot!", '. + 'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", '. + 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", '. 'response="b52938fc9e6d7c01be7702ece9031b42"' ); @@ -42,9 +42,9 @@ class DigestDataTest extends \PHPUnit_Framework_TestCase public function testGetUsernameWithQuote() { $digestAuth = new DigestData( - 'username="\"user\"", realm="Welcome, robot!", ' . - 'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", ' . - 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", ' . + 'username="\"user\"", realm="Welcome, robot!", '. + 'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", '. + 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", '. 'response="b52938fc9e6d7c01be7702ece9031b42"' ); @@ -54,9 +54,9 @@ class DigestDataTest extends \PHPUnit_Framework_TestCase public function testGetUsernameWithQuoteAndEscape() { $digestAuth = new DigestData( - 'username="\"u\\\\\"ser\"", realm="Welcome, robot!", ' . - 'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", ' . - 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", ' . + 'username="\"u\\\\\"ser\"", realm="Welcome, robot!", '. + 'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", '. + 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", '. 'response="b52938fc9e6d7c01be7702ece9031b42"' ); @@ -66,9 +66,9 @@ class DigestDataTest extends \PHPUnit_Framework_TestCase public function testGetUsernameWithSingleQuote() { $digestAuth = new DigestData( - 'username="\"u\'ser\"", realm="Welcome, robot!", ' . - 'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", ' . - 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", ' . + 'username="\"u\'ser\"", realm="Welcome, robot!", '. + 'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", '. + 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", '. 'response="b52938fc9e6d7c01be7702ece9031b42"' ); @@ -78,9 +78,9 @@ class DigestDataTest extends \PHPUnit_Framework_TestCase public function testGetUsernameWithSingleQuoteAndEscape() { $digestAuth = new DigestData( - 'username="\"u\\\'ser\"", realm="Welcome, robot!", ' . - 'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", ' . - 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", ' . + 'username="\"u\\\'ser\"", realm="Welcome, robot!", '. + 'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", '. + 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", '. 'response="b52938fc9e6d7c01be7702ece9031b42"' ); @@ -90,9 +90,9 @@ class DigestDataTest extends \PHPUnit_Framework_TestCase public function testGetUsernameWithEscape() { $digestAuth = new DigestData( - 'username="\"u\\ser\"", realm="Welcome, robot!", ' . - 'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", ' . - 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", ' . + 'username="\"u\\ser\"", realm="Welcome, robot!", '. + 'nonce="MTM0NzMyMTgyMy42NzkzOmRlZjM4NmIzOGNjMjE0OWJiNDU0MDAxNzJmYmM1MmZl", '. + 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", '. 'response="b52938fc9e6d7c01be7702ece9031b42"' ); @@ -106,8 +106,8 @@ class DigestDataTest extends \PHPUnit_Framework_TestCase $nonce = base64_encode($time.':'.md5($time.':'.$key)); $digestAuth = new DigestData( - 'username="user", realm="Welcome, robot!", nonce="'.$nonce.'", ' . - 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", ' . + 'username="user", realm="Welcome, robot!", nonce="'.$nonce.'", '. + 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", '. 'response="b52938fc9e6d7c01be7702ece9031b42"' ); @@ -146,8 +146,8 @@ class DigestDataTest extends \PHPUnit_Framework_TestCase $nonce = base64_encode($time.':'.md5($time.':'.$key)); $digestAuth = new DigestData( - 'username="user", realm="Welcome, robot!", nonce="'.$nonce.'", ' . - 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", ' . + 'username="user", realm="Welcome, robot!", nonce="'.$nonce.'", '. + 'uri="/path/info?p1=5&p2=5", cnonce="MDIwODkz", nc=00000001, qop="auth", '. 'response="b52938fc9e6d7c01be7702ece9031b42"' ); diff --git a/src/Symfony/Component/Security/Tests/Http/Firewall/X509AuthenticationListenerTest.php b/src/Symfony/Component/Security/Tests/Http/Firewall/X509AuthenticationListenerTest.php index 291f919b91..1ba7311ad5 100644 --- a/src/Symfony/Component/Security/Tests/Http/Firewall/X509AuthenticationListenerTest.php +++ b/src/Symfony/Component/Security/Tests/Http/Firewall/X509AuthenticationListenerTest.php @@ -113,7 +113,7 @@ class X509AuthenticationListenerTest extends \PHPUnit_Framework_TestCase $request = new Request(array(), array(), array(), array(), array(), array( 'TheUserKey' => 'TheUser', - 'TheCredentialsKey' => 'TheCredentials' + 'TheCredentialsKey' => 'TheCredentials', )); $context = $this->getMock('Symfony\Component\Security\Core\SecurityContextInterface'); diff --git a/src/Symfony/Component/Security/Tests/Http/FirewallTest.php b/src/Symfony/Component/Security/Tests/Http/FirewallTest.php index 0c1d82c180..8932b108a6 100644 --- a/src/Symfony/Component/Security/Tests/Http/FirewallTest.php +++ b/src/Symfony/Component/Security/Tests/Http/FirewallTest.php @@ -88,7 +88,7 @@ class FirewallTest extends \PHPUnit_Framework_TestCase array( $this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface'), $this->getMock('Symfony\Component\HttpFoundation\Request', array(), array(), '', false, false), - HttpKernelInterface::MASTER_REQUEST + HttpKernelInterface::MASTER_REQUEST, ) ); $event diff --git a/src/Symfony/Component/Security/Tests/Http/HttpUtilsTest.php b/src/Symfony/Component/Security/Tests/Http/HttpUtilsTest.php index db1aa4b94e..2e281fd48f 100644 --- a/src/Symfony/Component/Security/Tests/Http/HttpUtilsTest.php +++ b/src/Symfony/Component/Security/Tests/Http/HttpUtilsTest.php @@ -139,7 +139,7 @@ class HttpUtilsTest extends \PHPUnit_Framework_TestCase return array( array(SecurityContextInterface::AUTHENTICATION_ERROR), array(SecurityContextInterface::ACCESS_DENIED_ERROR), - array(SecurityContextInterface::LAST_USERNAME) + array(SecurityContextInterface::LAST_USERNAME), ); } diff --git a/src/Symfony/Component/Security/Tests/Http/RememberMe/AbstractRememberMeServicesTest.php b/src/Symfony/Component/Security/Tests/Http/RememberMe/AbstractRememberMeServicesTest.php index 02ca8d2519..67b415deea 100644 --- a/src/Symfony/Component/Security/Tests/Http/RememberMe/AbstractRememberMeServicesTest.php +++ b/src/Symfony/Component/Security/Tests/Http/RememberMe/AbstractRememberMeServicesTest.php @@ -250,7 +250,7 @@ class AbstractRememberMeServicesTest extends \PHPUnit_Framework_TestCase } return $this->getMockForAbstractClass('Symfony\Component\Security\Http\RememberMe\AbstractRememberMeServices', array( - array($userProvider), 'fookey', 'fookey', $options, $logger + array($userProvider), 'fookey', 'fookey', $options, $logger, )); } diff --git a/src/Symfony/Component/Security/Tests/Http/RememberMe/PersistentTokenBasedRememberMeServicesTest.php b/src/Symfony/Component/Security/Tests/Http/RememberMe/PersistentTokenBasedRememberMeServicesTest.php index 26a878f009..0d485f30bc 100644 --- a/src/Symfony/Component/Security/Tests/Http/RememberMe/PersistentTokenBasedRememberMeServicesTest.php +++ b/src/Symfony/Component/Security/Tests/Http/RememberMe/PersistentTokenBasedRememberMeServicesTest.php @@ -124,7 +124,8 @@ class PersistentTokenBasedRememberMeServicesTest extends \PHPUnit_Framework_Test try { $service->autoLogin($request); $this->fail('Expected CookieTheftException was not thrown.'); - } catch (CookieTheftException $theft) { } + } catch (CookieTheftException $theft) { + } $this->assertTrue($request->attributes->has(RememberMeServicesInterface::COOKIE_ATTR_NAME)); } diff --git a/src/Symfony/Component/Security/Tests/Http/RememberMe/ResponseListenerTest.php b/src/Symfony/Component/Security/Tests/Http/RememberMe/ResponseListenerTest.php index 8b4667d865..59e5fe267f 100644 --- a/src/Symfony/Component/Security/Tests/Http/RememberMe/ResponseListenerTest.php +++ b/src/Symfony/Component/Security/Tests/Http/RememberMe/ResponseListenerTest.php @@ -31,7 +31,7 @@ class ResponseListenerTest extends \PHPUnit_Framework_TestCase $cookie = new Cookie('rememberme'); $request = $this->getRequest(array( - RememberMeServicesInterface::COOKIE_ATTR_NAME => $cookie + RememberMeServicesInterface::COOKIE_ATTR_NAME => $cookie, )); $response = $this->getResponse(); diff --git a/src/Symfony/Component/Serializer/Encoder/JsonDecode.php b/src/Symfony/Component/Serializer/Encoder/JsonDecode.php index aad5b79cbb..6fa42c241e 100644 --- a/src/Symfony/Component/Serializer/Encoder/JsonDecode.php +++ b/src/Symfony/Component/Serializer/Encoder/JsonDecode.php @@ -123,7 +123,7 @@ class JsonDecode implements DecoderInterface $defaultOptions = array( 'json_decode_associative' => $this->associative, 'json_decode_recursion_depth' => $this->recursionDepth, - 'json_decode_options' => 0 + 'json_decode_options' => 0, ); return array_merge($defaultOptions, $context); diff --git a/src/Symfony/Component/Serializer/Encoder/JsonEncode.php b/src/Symfony/Component/Serializer/Encoder/JsonEncode.php index e8a06835d1..e2b276b74e 100644 --- a/src/Symfony/Component/Serializer/Encoder/JsonEncode.php +++ b/src/Symfony/Component/Serializer/Encoder/JsonEncode.php @@ -18,7 +18,7 @@ namespace Symfony\Component\Serializer\Encoder; */ class JsonEncode implements EncoderInterface { - private $options ; + private $options; private $lastError = JSON_ERROR_NONE; public function __construct($bitmask = 0) diff --git a/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php b/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php index ca3509a819..8e6ce2292f 100644 --- a/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php +++ b/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php @@ -435,5 +435,4 @@ class XmlEncoder extends SerializerAwareEncoder implements EncoderInterface, Dec ? $context['xml_root_node_name'] : $this->rootNodeName; } - } diff --git a/src/Symfony/Component/Serializer/Tests/Encoder/XmlEncoderTest.php b/src/Symfony/Component/Serializer/Tests/Encoder/XmlEncoderTest.php index b07b18e24d..f2ee035ce2 100644 --- a/src/Symfony/Component/Serializer/Tests/Encoder/XmlEncoderTest.php +++ b/src/Symfony/Component/Serializer/Tests/Encoder/XmlEncoderTest.php @@ -67,11 +67,11 @@ class XmlEncoderTest extends \PHPUnit_Framework_TestCase $obj->xmlFoo = array( 'foo-bar' => array( '@id' => 1, - '@name' => 'Bar' + '@name' => 'Bar', ), 'Foo' => array( 'Bar' => "Test", - '@Type' => 'test' + '@Type' => 'test', ), 'föo_bär' => 'a', "Bar" => array(1,2,3), @@ -124,7 +124,7 @@ class XmlEncoderTest extends \PHPUnit_Framework_TestCase { $array = array( '#' => 'Paul', - '@gender' => 'm' + '@gender' => 'm', ); $expected = ''."\n". @@ -137,7 +137,7 @@ class XmlEncoderTest extends \PHPUnit_Framework_TestCase { $array = array( 'firstname' => 'Paul', - '@gender' => 'm' + '@gender' => 'm', ); $expected = ''."\n". @@ -230,7 +230,7 @@ class XmlEncoderTest extends \PHPUnit_Framework_TestCase $expected = array( '#' => 'Peter', - '@gender' => 'M' + '@gender' => 'M', ); $this->assertEquals($expected, $this->encoder->decode($source, 'xml')); @@ -244,7 +244,7 @@ class XmlEncoderTest extends \PHPUnit_Framework_TestCase $expected = array( 'firstname' => 'Peter', 'lastname' => 'Mac Calloway', - '@gender' => 'M' + '@gender' => 'M', ); $this->assertEquals($expected, $this->encoder->decode($source, 'xml')); @@ -263,8 +263,8 @@ class XmlEncoderTest extends \PHPUnit_Framework_TestCase $expected = array( 'people' => array('person' => array( array('firstname' => 'Benjamin', 'lastname' => 'Alexandre'), - array('firstname' => 'Damien', 'lastname' => 'Clay') - )) + array('firstname' => 'Damien', 'lastname' => 'Clay'), + )), ); $this->assertEquals($expected, $this->encoder->decode($source, 'xml')); @@ -276,11 +276,11 @@ class XmlEncoderTest extends \PHPUnit_Framework_TestCase $obj->xmlFoo = array( 'foo-bar' => array( '@key' => "value", - 'item' => array("@key" => 'key', "key-val" => 'val') + 'item' => array("@key" => 'key', "key-val" => 'val'), ), 'Foo' => array( 'Bar' => "Test", - '@Type' => 'test' + '@Type' => 'test', ), 'föo_bär' => 'a', "Bar" => array(1,2,3), @@ -289,11 +289,11 @@ class XmlEncoderTest extends \PHPUnit_Framework_TestCase $expected = array( 'foo-bar' => array( '@key' => "value", - 'key' => array('@key' => 'key', "key-val" => 'val') + 'key' => array('@key' => 'key', "key-val" => 'val'), ), 'Foo' => array( 'Bar' => "Test", - '@Type' => 'test' + '@Type' => 'test', ), 'föo_bär' => 'a', "Bar" => array(1,2,3), diff --git a/src/Symfony/Component/Serializer/Tests/Fixtures/DenormalizableDummy.php b/src/Symfony/Component/Serializer/Tests/Fixtures/DenormalizableDummy.php index 09b8a52812..d78f34a3cd 100644 --- a/src/Symfony/Component/Serializer/Tests/Fixtures/DenormalizableDummy.php +++ b/src/Symfony/Component/Serializer/Tests/Fixtures/DenormalizableDummy.php @@ -16,10 +16,7 @@ use Symfony\Component\Serializer\Normalizer\DenormalizerInterface; class DenormalizableDummy implements DenormalizableInterface { - public function denormalize(DenormalizerInterface $denormalizer, $data, $format = null, array $context = array()) { - } - } diff --git a/src/Symfony/Component/Serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php b/src/Symfony/Component/Serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php index 1cbceece04..eb65810453 100644 --- a/src/Symfony/Component/Serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php +++ b/src/Symfony/Component/Serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php @@ -191,7 +191,7 @@ class GetSetMethodNormalizerTest extends \PHPUnit_Framework_TestCase ), 'baz', array('foo' => '', 'bar' => null), - 'Null an item' + 'Null an item', ), array( array( diff --git a/src/Symfony/Component/Stopwatch/Stopwatch.php b/src/Symfony/Component/Stopwatch/Stopwatch.php index 99d09529f6..9a5ab45a10 100644 --- a/src/Symfony/Component/Stopwatch/Stopwatch.php +++ b/src/Symfony/Component/Stopwatch/Stopwatch.php @@ -138,7 +138,6 @@ class Stopwatch } } - /** * @internal This class is for internal usage only * diff --git a/src/Symfony/Component/Stopwatch/Tests/StopwatchTest.php b/src/Symfony/Component/Stopwatch/Tests/StopwatchTest.php index 6805effb48..0e4b5f014e 100644 --- a/src/Symfony/Component/Stopwatch/Tests/StopwatchTest.php +++ b/src/Symfony/Component/Stopwatch/Tests/StopwatchTest.php @@ -62,7 +62,7 @@ class StopwatchTest extends \PHPUnit_Framework_TestCase 'foo' => $this->getMockBuilder('Symfony\Component\Stopwatch\StopwatchEvent') ->setConstructorArgs(array(microtime(true) * 1000)) - ->getMock()) + ->getMock(),) ); $this->assertFalse($stopwatch->isStarted('foo')); diff --git a/src/Symfony/Component/Translation/Dumper/PoFileDumper.php b/src/Symfony/Component/Translation/Dumper/PoFileDumper.php index c091d4c41e..983064b5d7 100644 --- a/src/Symfony/Component/Translation/Dumper/PoFileDumper.php +++ b/src/Symfony/Component/Translation/Dumper/PoFileDumper.php @@ -35,9 +35,9 @@ class PoFileDumper extends FileDumper $newLine = false; foreach ($messages->all($domain) as $source => $target) { if ($newLine) { - $output .= "\n"; + $output .= "\n"; } else { - $newLine = true; + $newLine = true; } $output .= sprintf('msgid "%s"'."\n", $this->escape($source)); $output .= sprintf('msgstr "%s"', $this->escape($target)); diff --git a/src/Symfony/Component/Translation/Dumper/YamlFileDumper.php b/src/Symfony/Component/Translation/Dumper/YamlFileDumper.php index 3fd3f1499d..5920fef20c 100644 --- a/src/Symfony/Component/Translation/Dumper/YamlFileDumper.php +++ b/src/Symfony/Component/Translation/Dumper/YamlFileDumper.php @@ -26,7 +26,7 @@ class YamlFileDumper extends FileDumper */ protected function format(MessageCatalogue $messages, $domain) { - return Yaml::dump($messages->all($domain)); + return Yaml::dump($messages->all($domain)); } /** diff --git a/src/Symfony/Component/Translation/Loader/ArrayLoader.php b/src/Symfony/Component/Translation/Loader/ArrayLoader.php index 99058fbfbf..b9ef7e5ea0 100644 --- a/src/Symfony/Component/Translation/Loader/ArrayLoader.php +++ b/src/Symfony/Component/Translation/Loader/ArrayLoader.php @@ -53,7 +53,7 @@ class ArrayLoader implements LoaderInterface private function flatten(array &$messages, array $subnode = null, $path = null) { if (null === $subnode) { - $subnode =& $messages; + $subnode = & $messages; } foreach ($subnode as $key => $value) { if (is_array($value)) { diff --git a/src/Symfony/Component/Translation/Loader/CsvFileLoader.php b/src/Symfony/Component/Translation/Loader/CsvFileLoader.php index bc10188c4c..f7f901236c 100644 --- a/src/Symfony/Component/Translation/Loader/CsvFileLoader.php +++ b/src/Symfony/Component/Translation/Loader/CsvFileLoader.php @@ -66,7 +66,7 @@ class CsvFileLoader extends ArrayLoader implements LoaderInterface if (count($data) == 2) { $messages[$data[0]] = $data[1]; } else { - continue; + continue; } } diff --git a/src/Symfony/Component/Translation/Loader/PoFileLoader.php b/src/Symfony/Component/Translation/Loader/PoFileLoader.php index a1aff1a872..6d5e835568 100644 --- a/src/Symfony/Component/Translation/Loader/PoFileLoader.php +++ b/src/Symfony/Component/Translation/Loader/PoFileLoader.php @@ -136,7 +136,6 @@ class PoFileLoader extends ArrayLoader implements LoaderInterface $size = strpos($line, ']'); $item['translated'][(int) substr($line, 7, 1)] = substr($line, $size + 3, -1); } - } // save last item $this->addMessage($messages, $item); @@ -172,7 +171,7 @@ class PoFileLoader extends ArrayLoader implements LoaderInterface $messages[stripcslashes($item['ids']['plural'])] = stripcslashes(implode('|', $plurals)); } } elseif (!empty($item['ids']['singular'])) { - $messages[stripcslashes($item['ids']['singular'])] = stripcslashes($item['translated']); + $messages[stripcslashes($item['ids']['singular'])] = stripcslashes($item['translated']); } } } diff --git a/src/Symfony/Component/Translation/Tests/Catalogue/DiffOperationTest.php b/src/Symfony/Component/Translation/Tests/Catalogue/DiffOperationTest.php index b70324285e..b0227d2550 100644 --- a/src/Symfony/Component/Translation/Tests/Catalogue/DiffOperationTest.php +++ b/src/Symfony/Component/Translation/Tests/Catalogue/DiffOperationTest.php @@ -44,7 +44,7 @@ class DiffOperationTest extends AbstractOperationTest { $this->assertEquals( new MessageCatalogue('en', array( - 'messages' => array('a' => 'old_a', 'c' => 'new_c') + 'messages' => array('a' => 'old_a', 'c' => 'new_c'), )), $this->createOperation( new MessageCatalogue('en', array('messages' => array('a' => 'old_a', 'b' => 'old_b'))), diff --git a/src/Symfony/Component/Translation/Tests/Catalogue/MergeOperationTest.php b/src/Symfony/Component/Translation/Tests/Catalogue/MergeOperationTest.php index 6f463b9a02..a97ec04ad1 100644 --- a/src/Symfony/Component/Translation/Tests/Catalogue/MergeOperationTest.php +++ b/src/Symfony/Component/Translation/Tests/Catalogue/MergeOperationTest.php @@ -44,7 +44,7 @@ class MergeOperationTest extends AbstractOperationTest { $this->assertEquals( new MessageCatalogue('en', array( - 'messages' => array('a' => 'old_a', 'b' => 'old_b', 'c' => 'new_c') + 'messages' => array('a' => 'old_a', 'b' => 'old_b', 'c' => 'new_c'), )), $this->createOperation( new MessageCatalogue('en', array('messages' => array('a' => 'old_a', 'b' => 'old_b'))), diff --git a/src/Symfony/Component/Translation/Tests/Dumper/IcuResFileDumperTest.php b/src/Symfony/Component/Translation/Tests/Dumper/IcuResFileDumperTest.php index cb30c6661c..f3b29ceadf 100644 --- a/src/Symfony/Component/Translation/Tests/Dumper/IcuResFileDumperTest.php +++ b/src/Symfony/Component/Translation/Tests/Dumper/IcuResFileDumperTest.php @@ -25,7 +25,7 @@ class IcuResFileDumperTest extends \PHPUnit_Framework_TestCase $catalogue = new MessageCatalogue('en'); $catalogue->add(array('foo' => 'bar')); - $tempDir = sys_get_temp_dir() . '/IcuResFileDumperTest'; + $tempDir = sys_get_temp_dir().'/IcuResFileDumperTest'; mkdir($tempDir); $dumper = new IcuResFileDumper(); $dumper->dump($catalogue, array('path' => $tempDir)); diff --git a/src/Symfony/Component/Translation/Tests/PluralizationRulesTest.php b/src/Symfony/Component/Translation/Tests/PluralizationRulesTest.php index 0381535468..2140013c54 100644 --- a/src/Symfony/Component/Translation/Tests/PluralizationRulesTest.php +++ b/src/Symfony/Component/Translation/Tests/PluralizationRulesTest.php @@ -28,7 +28,6 @@ use Symfony\Component\Translation\PluralizationRules; */ class PluralizationRulesTest extends \PHPUnit_Framework_TestCase { - /** * We test failed langcode here. * @@ -60,7 +59,7 @@ class PluralizationRulesTest extends \PHPUnit_Framework_TestCase */ public function successLangcodes() { - return array( + return array( array('1' , array('ay','bo', 'cgg','dz','id', 'ja', 'jbo', 'ka','kk','km','ko','ky')), array('2' , array('nl', 'fr', 'en', 'de', 'de_GE')), array('3' , array('be','bs','cs','hr')), @@ -80,7 +79,7 @@ class PluralizationRulesTest extends \PHPUnit_Framework_TestCase */ public function failingLangcodes() { - return array( + return array( array('1' , array('fa')), array('2' , array('jbo')), array('3' , array('cbs')), @@ -113,7 +112,7 @@ class PluralizationRulesTest extends \PHPUnit_Framework_TestCase { $matrix = array(); foreach ($langCodes as $langCode) { - for ($count=0; $count<200; $count++) { + for ($count = 0; $count<200; $count++) { $plural = PluralizationRules::get($count, $langCode); $matrix[$langCode][$count] = $plural; } diff --git a/src/Symfony/Component/Translation/Tests/TranslatorTest.php b/src/Symfony/Component/Translation/Tests/TranslatorTest.php index cf9c8df659..3fa87161d0 100644 --- a/src/Symfony/Component/Translation/Tests/TranslatorTest.php +++ b/src/Symfony/Component/Translation/Tests/TranslatorTest.php @@ -17,7 +17,6 @@ use Symfony\Component\Translation\Loader\ArrayLoader; class TranslatorTest extends \PHPUnit_Framework_TestCase { - /** * @dataProvider getInvalidLocalesTests * @expectedException \InvalidArgumentException @@ -356,12 +355,12 @@ class TranslatorTest extends \PHPUnit_Framework_TestCase $messages = array( 'symfony2' => array( 'is' => array( - 'great' => 'Symfony2 est super!' - ) + 'great' => 'Symfony2 est super!', + ), ), 'foo' => array( 'bar' => array( - 'baz' => 'Foo Bar Baz' + 'baz' => 'Foo Bar Baz', ), 'baz' => 'Foo Baz', ), diff --git a/src/Symfony/Component/Validator/Constraints/AbstractComparisonValidator.php b/src/Symfony/Component/Validator/Constraints/AbstractComparisonValidator.php index 2e8230bb83..3438a4daa6 100644 --- a/src/Symfony/Component/Validator/Constraints/AbstractComparisonValidator.php +++ b/src/Symfony/Component/Validator/Constraints/AbstractComparisonValidator.php @@ -34,7 +34,7 @@ abstract class AbstractComparisonValidator extends ConstraintValidator $this->context->addViolation($constraint->message, array( '{{ value }}' => $this->formatValue($value, self::OBJECT_TO_STRING | self::PRETTY_DATE), '{{ compared_value }}' => $this->formatValue($constraint->value, self::OBJECT_TO_STRING | self::PRETTY_DATE), - '{{ compared_value_type }}' => $this->formatTypeOf($constraint->value) + '{{ compared_value_type }}' => $this->formatTypeOf($constraint->value), )); } } diff --git a/src/Symfony/Component/Validator/Constraints/BlankValidator.php b/src/Symfony/Component/Validator/Constraints/BlankValidator.php index e8406a238e..8fde2b8dd0 100644 --- a/src/Symfony/Component/Validator/Constraints/BlankValidator.php +++ b/src/Symfony/Component/Validator/Constraints/BlankValidator.php @@ -28,7 +28,7 @@ class BlankValidator extends ConstraintValidator { if ('' !== $value && null !== $value) { $this->context->addViolation($constraint->message, array( - '{{ value }}' => $this->formatValue($value) + '{{ value }}' => $this->formatValue($value), )); } } diff --git a/src/Symfony/Component/Validator/Constraints/CardSchemeValidator.php b/src/Symfony/Component/Validator/Constraints/CardSchemeValidator.php index 73f602adce..76a202bc4d 100644 --- a/src/Symfony/Component/Validator/Constraints/CardSchemeValidator.php +++ b/src/Symfony/Component/Validator/Constraints/CardSchemeValidator.php @@ -28,14 +28,14 @@ class CardSchemeValidator extends ConstraintValidator * American Express card numbers start with 34 or 37 and have 15 digits. */ 'AMEX' => array( - '/^3[47][0-9]{13}$/' + '/^3[47][0-9]{13}$/', ), /** * China UnionPay cards start with 62 and have between 16 and 19 digits. * Please note that these cards do not follow Luhn Algorithm as a checksum. */ 'CHINA_UNIONPAY' => array( - '/^62[0-9]{14,17}$/' + '/^62[0-9]{14,17}$/', ), /** * Diners Club card numbers begin with 300 through 305, 36 or 38. All have 14 digits. @@ -53,45 +53,45 @@ class CardSchemeValidator extends ConstraintValidator '/^6011[0-9]{12}$/', '/^64[4-9][0-9]{13}$/', '/^65[0-9]{14}$/', - '/^622(12[6-9]|1[3-9][0-9]|[2-8][0-9][0-9]|91[0-9]|92[0-5])[0-9]{10}$/' + '/^622(12[6-9]|1[3-9][0-9]|[2-8][0-9][0-9]|91[0-9]|92[0-5])[0-9]{10}$/', ), /** * InstaPayment cards begin with 637 through 639 and have 16 digits */ 'INSTAPAYMENT' => array( - '/^63[7-9][0-9]{13}$/' + '/^63[7-9][0-9]{13}$/', ), /** * JCB cards beginning with 2131 or 1800 have 15 digits. * JCB cards beginning with 35 have 16 digits. */ 'JCB' => array( - '/^(?:2131|1800|35[0-9]{3})[0-9]{11}$/' + '/^(?:2131|1800|35[0-9]{3})[0-9]{11}$/', ), /** * Laser cards begin with either 6304, 6706, 6709 or 6771 and have between 16 and 19 digits */ 'LASER' => array( - '/^(6304|670[69]|6771)[0-9]{12,15}$/' + '/^(6304|670[69]|6771)[0-9]{12,15}$/', ), /** * Maestro cards begin with either 5018, 5020, 5038, 5893, 6304, 6759, 6761, 6762, 6763 or 0604 * They have between 12 and 19 digits */ 'MAESTRO' => array( - '/^(5018|5020|5038|6304|6759|6761|676[23]|0604)[0-9]{8,15}$/' + '/^(5018|5020|5038|6304|6759|6761|676[23]|0604)[0-9]{8,15}$/', ), /** * All MasterCard numbers start with the numbers 51 through 55. All have 16 digits. */ 'MASTERCARD' => array( - '/^5[1-5][0-9]{14}$/' + '/^5[1-5][0-9]{14}$/', ), /** * All Visa card numbers start with a 4. New cards have 16 digits. Old cards have 13. */ 'VISA' => array( - '/^4([0-9]{12}|[0-9]{15})$/' + '/^4([0-9]{12}|[0-9]{15})$/', ), ); diff --git a/src/Symfony/Component/Validator/Constraints/ChoiceValidator.php b/src/Symfony/Component/Validator/Constraints/ChoiceValidator.php index 79081fee49..93f13c75da 100644 --- a/src/Symfony/Component/Validator/Constraints/ChoiceValidator.php +++ b/src/Symfony/Component/Validator/Constraints/ChoiceValidator.php @@ -69,7 +69,7 @@ class ChoiceValidator extends ConstraintValidator if ($constraint->min !== null && $count < $constraint->min) { $this->context->addViolation($constraint->minMessage, array( - '{{ limit }}' => $constraint->min + '{{ limit }}' => $constraint->min, ), $value, (int) $constraint->min); return; @@ -77,14 +77,14 @@ class ChoiceValidator extends ConstraintValidator if ($constraint->max !== null && $count > $constraint->max) { $this->context->addViolation($constraint->maxMessage, array( - '{{ limit }}' => $constraint->max + '{{ limit }}' => $constraint->max, ), $value, (int) $constraint->max); return; } } elseif (!in_array($value, $choices, $constraint->strict)) { $this->context->addViolation($constraint->message, array( - '{{ value }}' => $this->formatValue($value) + '{{ value }}' => $this->formatValue($value), )); } } diff --git a/src/Symfony/Component/Validator/Constraints/CollectionValidator.php b/src/Symfony/Component/Validator/Constraints/CollectionValidator.php index 33f839d3b9..4c6a714e7e 100644 --- a/src/Symfony/Component/Validator/Constraints/CollectionValidator.php +++ b/src/Symfony/Component/Validator/Constraints/CollectionValidator.php @@ -46,7 +46,7 @@ class CollectionValidator extends ConstraintValidator $this->context->validateValue($value[$field], $fieldConstraint->constraints, '['.$field.']', $group); } elseif (!$fieldConstraint instanceof Optional && !$constraint->allowMissingFields) { $this->context->addViolationAt('['.$field.']', $constraint->missingFieldsMessage, array( - '{{ field }}' => $this->formatValue($field) + '{{ field }}' => $this->formatValue($field), ), null); } } @@ -55,7 +55,7 @@ class CollectionValidator extends ConstraintValidator foreach ($value as $field => $fieldValue) { if (!isset($constraint->fields[$field])) { $this->context->addViolationAt('['.$field.']', $constraint->extraFieldsMessage, array( - '{{ field }}' => $this->formatValue($field) + '{{ field }}' => $this->formatValue($field), ), $fieldValue); } } diff --git a/src/Symfony/Component/Validator/Constraints/FileValidator.php b/src/Symfony/Component/Validator/Constraints/FileValidator.php index 006064594b..44378e681e 100644 --- a/src/Symfony/Component/Validator/Constraints/FileValidator.php +++ b/src/Symfony/Component/Validator/Constraints/FileValidator.php @@ -97,7 +97,7 @@ class FileValidator extends ConstraintValidator if (!is_file($path)) { $this->context->addViolation($constraint->notFoundMessage, array( - '{{ file }}' => $this->formatValue($path) + '{{ file }}' => $this->formatValue($path), )); return; @@ -105,7 +105,7 @@ class FileValidator extends ConstraintValidator if (!is_readable($path)) { $this->context->addViolation($constraint->notReadableMessage, array( - '{{ file }}' => $this->formatValue($path) + '{{ file }}' => $this->formatValue($path), )); return; diff --git a/src/Symfony/Component/Validator/Constraints/ImageValidator.php b/src/Symfony/Component/Validator/Constraints/ImageValidator.php index 79890b8304..1671565762 100644 --- a/src/Symfony/Component/Validator/Constraints/ImageValidator.php +++ b/src/Symfony/Component/Validator/Constraints/ImageValidator.php @@ -60,7 +60,7 @@ class ImageValidator extends FileValidator if ($width < $constraint->minWidth) { $this->context->addViolation($constraint->minWidthMessage, array( '{{ width }}' => $width, - '{{ min_width }}' => $constraint->minWidth + '{{ min_width }}' => $constraint->minWidth, )); return; @@ -75,7 +75,7 @@ class ImageValidator extends FileValidator if ($width > $constraint->maxWidth) { $this->context->addViolation($constraint->maxWidthMessage, array( '{{ width }}' => $width, - '{{ max_width }}' => $constraint->maxWidth + '{{ max_width }}' => $constraint->maxWidth, )); return; @@ -90,7 +90,7 @@ class ImageValidator extends FileValidator if ($height < $constraint->minHeight) { $this->context->addViolation($constraint->minHeightMessage, array( '{{ height }}' => $height, - '{{ min_height }}' => $constraint->minHeight + '{{ min_height }}' => $constraint->minHeight, )); return; @@ -105,7 +105,7 @@ class ImageValidator extends FileValidator if ($height > $constraint->maxHeight) { $this->context->addViolation($constraint->maxHeightMessage, array( '{{ height }}' => $height, - '{{ max_height }}' => $constraint->maxHeight + '{{ max_height }}' => $constraint->maxHeight, )); } } diff --git a/src/Symfony/Component/Validator/Constraints/IsbnValidator.php b/src/Symfony/Component/Validator/Constraints/IsbnValidator.php index 5fee10e718..4f246960f3 100644 --- a/src/Symfony/Component/Validator/Constraints/IsbnValidator.php +++ b/src/Symfony/Component/Validator/Constraints/IsbnValidator.php @@ -100,7 +100,8 @@ class IsbnValidator extends ConstraintValidator } for ($i = 1; $i < 12; $i += 2) { - $checkSum += $isbn{$i} * 3; + $checkSum += $isbn{$i} + * 3; } return 0 === $checkSum % 10; diff --git a/src/Symfony/Component/Validator/Constraints/IssnValidator.php b/src/Symfony/Component/Validator/Constraints/IssnValidator.php index 301b40d2d9..24618eac50 100644 --- a/src/Symfony/Component/Validator/Constraints/IssnValidator.php +++ b/src/Symfony/Component/Validator/Constraints/IssnValidator.php @@ -55,7 +55,8 @@ class IssnValidator extends ConstraintValidator $canonical = strtoupper(str_replace('-', '', $value)); // Calculate a checksum. "X" equals 10. - $checkSum = 'X' === $canonical{7} ? 10 : $canonical{7}; + $checkSum = 'X' === $canonical{7} + ? 10 : $canonical{7}; for ($i = 0; $i < 7; ++$i) { // Multiply the first digit by 8, the second by 7, etc. diff --git a/src/Symfony/Component/Validator/Mapping/ClassMetadata.php b/src/Symfony/Component/Validator/Mapping/ClassMetadata.php index 792d8e5140..981ec55e0c 100644 --- a/src/Symfony/Component/Validator/Mapping/ClassMetadata.php +++ b/src/Symfony/Component/Validator/Mapping/ClassMetadata.php @@ -131,7 +131,7 @@ class ClassMetadata extends ElementMetadata implements MetadataInterface, ClassB 'members', 'name', 'properties', - 'defaultGroup' + 'defaultGroup', )); } diff --git a/src/Symfony/Component/Validator/Tests/ConstraintTest.php b/src/Symfony/Component/Validator/Tests/ConstraintTest.php index f1f73fca06..63eaf6242a 100644 --- a/src/Symfony/Component/Validator/Tests/ConstraintTest.php +++ b/src/Symfony/Component/Validator/Tests/ConstraintTest.php @@ -53,7 +53,7 @@ class ConstraintTest extends \PHPUnit_Framework_TestCase new ConstraintC(array( 'option1' => 'default', - 'foo' => 'bar' + 'foo' => 'bar', )); } diff --git a/src/Symfony/Component/Validator/Tests/Constraints/AbstractComparisonValidatorTestCase.php b/src/Symfony/Component/Validator/Tests/Constraints/AbstractComparisonValidatorTestCase.php index a56f734554..8ced06b1bd 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/AbstractComparisonValidatorTestCase.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/AbstractComparisonValidatorTestCase.php @@ -87,7 +87,7 @@ abstract class AbstractComparisonValidatorTestCase extends AbstractConstraintVal $this->assertViolation('Constraint Message', array( '{{ value }}' => $dirtyValueAsString, '{{ compared_value }}' => $comparedValueString, - '{{ compared_value_type }}' => $comparedValueType + '{{ compared_value_type }}' => $comparedValueType, )); } diff --git a/src/Symfony/Component/Validator/Tests/Constraints/AbstractConstraintValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/AbstractConstraintValidatorTest.php index bc4e1c214a..864b58a35b 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/AbstractConstraintValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/AbstractConstraintValidatorTest.php @@ -74,7 +74,7 @@ abstract class AbstractConstraintValidatorTest extends \PHPUnit_Framework_TestCa $this->metadata, $this->value, $this->group, - $this->propertyPath + $this->propertyPath, )) ->setMethods(array('validate', 'validateValue')) ->getMock(); diff --git a/src/Symfony/Component/Validator/Tests/Constraints/BlankValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/BlankValidatorTest.php index 1d83d10b0f..c73a4a9cf6 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/BlankValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/BlankValidatorTest.php @@ -41,7 +41,7 @@ class BlankValidatorTest extends AbstractConstraintValidatorTest public function testInvalidValues($value, $valueAsString) { $constraint = new Blank(array( - 'message' => 'myMessage' + 'message' => 'myMessage', )); $this->validator->validate($value, $constraint); diff --git a/src/Symfony/Component/Validator/Tests/Constraints/CallbackValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/CallbackValidatorTest.php index 038f1a3911..377999bc76 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/CallbackValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/CallbackValidatorTest.php @@ -121,7 +121,7 @@ class CallbackValidatorTest extends AbstractConstraintValidatorTest { $object = new CallbackValidatorTest_Object(); $constraint = new Callback(array( - array(__CLASS__.'_Class', 'validateCallback') + array(__CLASS__.'_Class', 'validateCallback'), )); $this->validator->validate($object, $constraint); diff --git a/src/Symfony/Component/Validator/Tests/Constraints/ChoiceValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/ChoiceValidatorTest.php index 113a31e3cf..335f620218 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/ChoiceValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/ChoiceValidatorTest.php @@ -89,7 +89,7 @@ class ChoiceValidatorTest extends AbstractConstraintValidatorTest { $constraint = new Choice(array('callback' => function () { return array('foo', 'bar'); - })); + },)); $this->validator->validate('bar', $constraint); @@ -228,7 +228,7 @@ class ChoiceValidatorTest extends AbstractConstraintValidatorTest $constraint = new Choice(array( 'choices' => array(1, 2), 'strict' => true, - 'message' => 'myMessage' + 'message' => 'myMessage', )); $this->validator->validate('2', $constraint); @@ -243,7 +243,7 @@ class ChoiceValidatorTest extends AbstractConstraintValidatorTest $constraint = new Choice(array( 'choices' => array(1, 2, 3), 'multiple' => true, - 'strict' => false + 'strict' => false, )); $this->validator->validate(array('2', 3), $constraint); diff --git a/src/Symfony/Component/Validator/Tests/Constraints/CollectionValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/CollectionValidatorTest.php index 8c26957e6f..a620ee576c 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/CollectionValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/CollectionValidatorTest.php @@ -112,7 +112,7 @@ abstract class CollectionValidatorTest extends AbstractConstraintValidatorTest 'fields' => array( 'foo' => $constraints, 'bar' => $constraints, - ) + ), ))); $this->assertNoViolation(); @@ -137,7 +137,7 @@ abstract class CollectionValidatorTest extends AbstractConstraintValidatorTest ))); $this->assertViolation('myMessage', array( - '{{ field }}' => '"baz"' + '{{ field }}' => '"baz"', ), 'property.path[baz]', 6); } @@ -196,7 +196,7 @@ abstract class CollectionValidatorTest extends AbstractConstraintValidatorTest ))); $this->assertViolation('myMessage', array( - '{{ field }}' => '"foo"' + '{{ field }}' => '"foo"', ), 'property.path[foo]', null); } @@ -306,7 +306,7 @@ abstract class CollectionValidatorTest extends AbstractConstraintValidatorTest ))); $this->assertViolation('myMessage', array( - '{{ field }}' => '"foo"' + '{{ field }}' => '"foo"', ), 'property.path[foo]', null); } @@ -354,7 +354,7 @@ abstract class CollectionValidatorTest extends AbstractConstraintValidatorTest public function testObjectShouldBeLeftUnchanged() { $value = new \ArrayObject(array( - 'foo' => 3 + 'foo' => 3, )); $constraint = new Range(array('min' => 2)); @@ -364,11 +364,11 @@ abstract class CollectionValidatorTest extends AbstractConstraintValidatorTest $this->validator->validate($value, new Collection(array( 'fields' => array( 'foo' => $constraint, - ) + ), ))); $this->assertEquals(array( - 'foo' => 3 + 'foo' => 3, ), (array) $value); } } diff --git a/src/Symfony/Component/Validator/Tests/Constraints/CountValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/CountValidatorTest.php index c910c1156c..1b8bb09232 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/CountValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/CountValidatorTest.php @@ -116,7 +116,7 @@ abstract class CountValidatorTest extends AbstractConstraintValidatorTest { $constraint = new Count(array( 'max' => 4, - 'maxMessage' => 'myMessage' + 'maxMessage' => 'myMessage', )); $this->validator->validate($value, $constraint); @@ -134,7 +134,7 @@ abstract class CountValidatorTest extends AbstractConstraintValidatorTest { $constraint = new Count(array( 'min' => 4, - 'minMessage' => 'myMessage' + 'minMessage' => 'myMessage', )); $this->validator->validate($value, $constraint); @@ -153,7 +153,7 @@ abstract class CountValidatorTest extends AbstractConstraintValidatorTest $constraint = new Count(array( 'min' => 4, 'max' => 4, - 'exactMessage' => 'myMessage' + 'exactMessage' => 'myMessage', )); $this->validator->validate($value, $constraint); diff --git a/src/Symfony/Component/Validator/Tests/Constraints/CountryValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/CountryValidatorTest.php index c6693020f8..a8090aee20 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/CountryValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/CountryValidatorTest.php @@ -76,7 +76,7 @@ class CountryValidatorTest extends AbstractConstraintValidatorTest public function testInvalidCountries($country) { $constraint = new Country(array( - 'message' => 'myMessage' + 'message' => 'myMessage', )); $this->validator->validate($country, $constraint); diff --git a/src/Symfony/Component/Validator/Tests/Constraints/CurrencyValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/CurrencyValidatorTest.php index 0480b60ed7..c9238c2711 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/CurrencyValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/CurrencyValidatorTest.php @@ -90,7 +90,7 @@ class CurrencyValidatorTest extends AbstractConstraintValidatorTest public function testInvalidCurrencies($currency) { $constraint = new Currency(array( - 'message' => 'myMessage' + 'message' => 'myMessage', )); $this->validator->validate($currency, $constraint); diff --git a/src/Symfony/Component/Validator/Tests/Constraints/DateTimeValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/DateTimeValidatorTest.php index 5addbf34de..76961236d3 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/DateTimeValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/DateTimeValidatorTest.php @@ -75,7 +75,7 @@ class DateTimeValidatorTest extends AbstractConstraintValidatorTest public function testInvalidDateTimes($dateTime) { $constraint = new DateTime(array( - 'message' => 'myMessage' + 'message' => 'myMessage', )); $this->validator->validate($dateTime, $constraint); diff --git a/src/Symfony/Component/Validator/Tests/Constraints/DateValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/DateValidatorTest.php index 8fdacee94d..2adcd46a43 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/DateValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/DateValidatorTest.php @@ -75,7 +75,7 @@ class DateValidatorTest extends AbstractConstraintValidatorTest public function testInvalidDates($date) { $constraint = new Date(array( - 'message' => 'myMessage' + 'message' => 'myMessage', )); $this->validator->validate($date, $constraint); diff --git a/src/Symfony/Component/Validator/Tests/Constraints/EmailValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/EmailValidatorTest.php index e4722e159e..18e23b8b4d 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/EmailValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/EmailValidatorTest.php @@ -68,7 +68,7 @@ class EmailValidatorTest extends AbstractConstraintValidatorTest public function testInvalidEmails($email) { $constraint = new Email(array( - 'message' => 'myMessage' + 'message' => 'myMessage', )); $this->validator->validate($email, $constraint); diff --git a/src/Symfony/Component/Validator/Tests/Constraints/FalseValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/FalseValidatorTest.php index e9abbb9a38..7de6b9c5ae 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/FalseValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/FalseValidatorTest.php @@ -38,13 +38,13 @@ class FalseValidatorTest extends AbstractConstraintValidatorTest public function testTrueIsInvalid() { $constraint = new False(array( - 'message' => 'myMessage' + 'message' => 'myMessage', )); $this->validator->validate(true, $constraint); $this->assertViolation('myMessage', array( - '{{ value }}' => 'true' + '{{ value }}' => 'true', )); } } diff --git a/src/Symfony/Component/Validator/Tests/Constraints/FileValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/FileValidatorTest.php index 6c8cb8abbb..c93a514304 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/FileValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/FileValidatorTest.php @@ -353,13 +353,12 @@ abstract class FileValidatorTest extends AbstractConstraintValidatorTest $constraint = new File(array( $message => 'myMessage', - 'maxSize' => $maxSize + 'maxSize' => $maxSize, )); $this->validator->validate($file, $constraint); $this->assertViolation('myMessage', $params); - } public function uploadedFileErrorProvider() diff --git a/src/Symfony/Component/Validator/Tests/Constraints/GreaterThanOrEqualValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/GreaterThanOrEqualValidatorTest.php index bb90f7c283..0d7327ad36 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/GreaterThanOrEqualValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/GreaterThanOrEqualValidatorTest.php @@ -53,7 +53,7 @@ class GreaterThanOrEqualValidatorTest extends AbstractComparisonValidatorTestCas return array( array(1, '1', 2, '2', 'integer'), array(new \DateTime('2000/01/01'), 'Jan 1, 2000, 12:00 AM', new \DateTime('2005/01/01'), 'Jan 1, 2005, 12:00 AM', 'DateTime'), - array('b', '"b"', 'c', '"c"', 'string') + array('b', '"b"', 'c', '"c"', 'string'), ); } } diff --git a/src/Symfony/Component/Validator/Tests/Constraints/GreaterThanValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/GreaterThanValidatorTest.php index 64c5dbff65..dea2bc0cd3 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/GreaterThanValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/GreaterThanValidatorTest.php @@ -56,7 +56,7 @@ class GreaterThanValidatorTest extends AbstractComparisonValidatorTestCase array(new ComparisonTest_Class(4), '4', new ComparisonTest_Class(5), '5', __NAMESPACE__.'\ComparisonTest_Class'), array(new ComparisonTest_Class(5), '5', new ComparisonTest_Class(5), '5', __NAMESPACE__.'\ComparisonTest_Class'), array('22', '"22"', '333', '"333"', 'string'), - array('22', '"22"', '22', '"22"', 'string') + array('22', '"22"', '22', '"22"', 'string'), ); } } diff --git a/src/Symfony/Component/Validator/Tests/Constraints/IbanValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/IbanValidatorTest.php index 8cf7f5ae53..6a84a66324 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/IbanValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/IbanValidatorTest.php @@ -13,7 +13,6 @@ namespace Symfony\Component\Validator\Tests\Constraints; use Symfony\Component\Validator\Constraints\Iban; use Symfony\Component\Validator\Constraints\IbanValidator; -use Symfony\Component\Validator\Validation; class IbanValidatorTest extends AbstractConstraintValidatorTest { @@ -154,7 +153,7 @@ class IbanValidatorTest extends AbstractConstraintValidatorTest public function testInvalidIbans($iban) { $constraint = new Iban(array( - 'message' => 'myMessage' + 'message' => 'myMessage', )); $this->validator->validate($iban, $constraint); @@ -181,7 +180,7 @@ class IbanValidatorTest extends AbstractConstraintValidatorTest //Ibans with lower case values are invalid array('Ae260211000000230064016'), - array('ae260211000000230064016') + array('ae260211000000230064016'), ); } } diff --git a/src/Symfony/Component/Validator/Tests/Constraints/ImageValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/ImageValidatorTest.php index 01f1a06199..35a934ee27 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/ImageValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/ImageValidatorTest.php @@ -13,7 +13,6 @@ namespace Symfony\Component\Validator\Tests\Constraints; use Symfony\Component\Validator\Constraints\Image; use Symfony\Component\Validator\Constraints\ImageValidator; -use Symfony\Component\Validator\Validation; class ImageValidatorTest extends AbstractConstraintValidatorTest { diff --git a/src/Symfony/Component/Validator/Tests/Constraints/IpValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/IpValidatorTest.php index bc849278de..5316330623 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/IpValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/IpValidatorTest.php @@ -13,7 +13,6 @@ namespace Symfony\Component\Validator\Tests\Constraints; use Symfony\Component\Validator\Constraints\Ip; use Symfony\Component\Validator\Constraints\IpValidator; -use Symfony\Component\Validator\Validation; class IpValidatorTest extends AbstractConstraintValidatorTest { diff --git a/src/Symfony/Component/Validator/Tests/Constraints/IsbnValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/IsbnValidatorTest.php index bb49937dfd..8de704edee 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/IsbnValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/IsbnValidatorTest.php @@ -13,7 +13,6 @@ namespace Symfony\Component\Validator\Tests\Constraints; use Symfony\Component\Validator\Constraints\Isbn; use Symfony\Component\Validator\Constraints\IsbnValidator; -use Symfony\Component\Validator\Validation; /** * @see https://en.wikipedia.org/wiki/Isbn @@ -40,7 +39,7 @@ class IsbnValidatorTest extends AbstractConstraintValidatorTest array('0321812700'), array('0-45122-5244'), array('0-4712-92311'), - array('0-9752298-0-X') + array('0-9752298-0-X'), ); } @@ -181,7 +180,7 @@ class IsbnValidatorTest extends AbstractConstraintValidatorTest */ public function testValidIsbn13($isbn) { - $constraint = new Isbn(array('isbn13' => true,)); + $constraint = new Isbn(array('isbn13' => true)); $this->validator->validate($isbn, $constraint); diff --git a/src/Symfony/Component/Validator/Tests/Constraints/IssnValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/IssnValidatorTest.php index b48357a880..992536ebf2 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/IssnValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/IssnValidatorTest.php @@ -13,7 +13,6 @@ namespace Symfony\Component\Validator\Tests\Constraints; use Symfony\Component\Validator\Constraints\Issn; use Symfony\Component\Validator\Constraints\IssnValidator; -use Symfony\Component\Validator\Validation; /** * @see https://en.wikipedia.org/wiki/Issn @@ -79,7 +78,7 @@ class IssnValidatorTest extends AbstractConstraintValidatorTest return array( array(0), array('1539'), - array('2156-537A') + array('2156-537A'), ); } @@ -92,7 +91,6 @@ class IssnValidatorTest extends AbstractConstraintValidatorTest array('1684-537X'), array('1996-0795'), ); - } public function getInvalidIssn() diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LanguageValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LanguageValidatorTest.php index ad2b1e8971..5ef9d3a6ef 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/LanguageValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/LanguageValidatorTest.php @@ -76,7 +76,7 @@ class LanguageValidatorTest extends AbstractConstraintValidatorTest public function testInvalidLanguages($language) { $constraint = new Language(array( - 'message' => 'myMessage' + 'message' => 'myMessage', )); $this->validator->validate($language, $constraint); @@ -100,7 +100,7 @@ class LanguageValidatorTest extends AbstractConstraintValidatorTest $existingLanguage = 'en'; $this->validator->validate($existingLanguage, new Language(array( - 'message' => 'aMessage' + 'message' => 'aMessage', ))); $this->assertNoViolation(); diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LengthValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LengthValidatorTest.php index 31039c08ae..4457d264dd 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/LengthValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/LengthValidatorTest.php @@ -13,7 +13,6 @@ namespace Symfony\Component\Validator\Tests\Constraints; use Symfony\Component\Validator\Constraints\Length; use Symfony\Component\Validator\Constraints\LengthValidator; -use Symfony\Component\Validator\Validation; class LengthValidatorTest extends AbstractConstraintValidatorTest { @@ -146,7 +145,7 @@ class LengthValidatorTest extends AbstractConstraintValidatorTest $constraint = new Length(array( 'min' => 4, - 'minMessage' => 'myMessage' + 'minMessage' => 'myMessage', )); $this->validator->validate($value, $constraint); @@ -168,7 +167,7 @@ class LengthValidatorTest extends AbstractConstraintValidatorTest $constraint = new Length(array( 'max' => 4, - 'maxMessage' => 'myMessage' + 'maxMessage' => 'myMessage', )); $this->validator->validate($value, $constraint); @@ -191,7 +190,7 @@ class LengthValidatorTest extends AbstractConstraintValidatorTest $constraint = new Length(array( 'min' => 4, 'max' => 4, - 'exactMessage' => 'myMessage' + 'exactMessage' => 'myMessage', )); $this->validator->validate($value, $constraint); diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LessThanOrEqualValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LessThanOrEqualValidatorTest.php index 0f4f749b8b..71da446386 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/LessThanOrEqualValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/LessThanOrEqualValidatorTest.php @@ -56,7 +56,7 @@ class LessThanOrEqualValidatorTest extends AbstractComparisonValidatorTestCase array(2, '2', 1, '1', 'integer'), array(new \DateTime('2010-01-01'), 'Jan 1, 2010, 12:00 AM', new \DateTime('2000-01-01'), 'Jan 1, 2000, 12:00 AM', 'DateTime'), array(new ComparisonTest_Class(5), '5', new ComparisonTest_Class(4), '4', __NAMESPACE__.'\ComparisonTest_Class'), - array('c', '"c"', 'b', '"b"', 'string') + array('c', '"c"', 'b', '"b"', 'string'), ); } } diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LocaleValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LocaleValidatorTest.php index 8c76485e53..31d988df59 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/LocaleValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/LocaleValidatorTest.php @@ -78,7 +78,7 @@ class LocaleValidatorTest extends AbstractConstraintValidatorTest public function testInvalidLocales($locale) { $constraint = new Locale(array( - 'message' => 'myMessage' + 'message' => 'myMessage', )); $this->validator->validate($locale, $constraint); diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LuhnValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LuhnValidatorTest.php index 9b02bf6492..830c0436ea 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/LuhnValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/LuhnValidatorTest.php @@ -13,7 +13,6 @@ namespace Symfony\Component\Validator\Tests\Constraints; use Symfony\Component\Validator\Constraints\Luhn; use Symfony\Component\Validator\Constraints\LuhnValidator; -use Symfony\Component\Validator\Validation; class LuhnValidatorTest extends AbstractConstraintValidatorTest { diff --git a/src/Symfony/Component/Validator/Tests/Constraints/NotBlankValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/NotBlankValidatorTest.php index fe28951466..0f9337b8b7 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/NotBlankValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/NotBlankValidatorTest.php @@ -13,7 +13,6 @@ namespace Symfony\Component\Validator\Tests\Constraints; use Symfony\Component\Validator\Constraints\NotBlank; use Symfony\Component\Validator\Constraints\NotBlankValidator; -use Symfony\Component\Validator\Validation; class NotBlankValidatorTest extends AbstractConstraintValidatorTest { @@ -46,7 +45,7 @@ class NotBlankValidatorTest extends AbstractConstraintValidatorTest public function testNullIsInvalid() { $constraint = new NotBlank(array( - 'message' => 'myMessage' + 'message' => 'myMessage', )); $this->validator->validate(null, $constraint); @@ -59,7 +58,7 @@ class NotBlankValidatorTest extends AbstractConstraintValidatorTest public function testBlankIsInvalid() { $constraint = new NotBlank(array( - 'message' => 'myMessage' + 'message' => 'myMessage', )); $this->validator->validate('', $constraint); @@ -72,7 +71,7 @@ class NotBlankValidatorTest extends AbstractConstraintValidatorTest public function testFalseIsInvalid() { $constraint = new NotBlank(array( - 'message' => 'myMessage' + 'message' => 'myMessage', )); $this->validator->validate(false, $constraint); @@ -85,7 +84,7 @@ class NotBlankValidatorTest extends AbstractConstraintValidatorTest public function testEmptyArrayIsInvalid() { $constraint = new NotBlank(array( - 'message' => 'myMessage' + 'message' => 'myMessage', )); $this->validator->validate(array(), $constraint); diff --git a/src/Symfony/Component/Validator/Tests/Constraints/NotNullValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/NotNullValidatorTest.php index 8224423e9b..f9de951b61 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/NotNullValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/NotNullValidatorTest.php @@ -13,7 +13,6 @@ namespace Symfony\Component\Validator\Tests\Constraints; use Symfony\Component\Validator\Constraints\NotNull; use Symfony\Component\Validator\Constraints\NotNullValidator; -use Symfony\Component\Validator\Validation; class NotNullValidatorTest extends AbstractConstraintValidatorTest { @@ -45,7 +44,7 @@ class NotNullValidatorTest extends AbstractConstraintValidatorTest public function testNullIsInvalid() { $constraint = new NotNull(array( - 'message' => 'myMessage' + 'message' => 'myMessage', )); $this->validator->validate(null, $constraint); diff --git a/src/Symfony/Component/Validator/Tests/Constraints/NullValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/NullValidatorTest.php index b659bc029a..a66bf83414 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/NullValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/NullValidatorTest.php @@ -13,7 +13,6 @@ namespace Symfony\Component\Validator\Tests\Constraints; use Symfony\Component\Validator\Constraints\Null; use Symfony\Component\Validator\Constraints\NullValidator; -use Symfony\Component\Validator\Validation; class NullValidatorTest extends AbstractConstraintValidatorTest { @@ -35,7 +34,7 @@ class NullValidatorTest extends AbstractConstraintValidatorTest public function testInvalidValues($value, $valueAsString) { $constraint = new Null(array( - 'message' => 'myMessage' + 'message' => 'myMessage', )); $this->validator->validate($value, $constraint); diff --git a/src/Symfony/Component/Validator/Tests/Constraints/RangeValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/RangeValidatorTest.php index 9c043a6d56..3af24e896c 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/RangeValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/RangeValidatorTest.php @@ -13,7 +13,6 @@ namespace Symfony\Component\Validator\Tests\Constraints; use Symfony\Component\Validator\Constraints\Range; use Symfony\Component\Validator\Constraints\RangeValidator; -use Symfony\Component\Validator\Validation; class RangeValidatorTest extends AbstractConstraintValidatorTest { diff --git a/src/Symfony/Component/Validator/Tests/Constraints/RegexValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/RegexValidatorTest.php index 91f0c0532f..e28a8e03cc 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/RegexValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/RegexValidatorTest.php @@ -13,7 +13,6 @@ namespace Symfony\Component\Validator\Tests\Constraints; use Symfony\Component\Validator\Constraints\Regex; use Symfony\Component\Validator\Constraints\RegexValidator; -use Symfony\Component\Validator\Validation; class RegexValidatorTest extends AbstractConstraintValidatorTest { @@ -72,7 +71,7 @@ class RegexValidatorTest extends AbstractConstraintValidatorTest { $constraint = new Regex(array( 'pattern' => '/^[0-9]+$/', - 'message' => 'myMessage' + 'message' => 'myMessage', )); $this->validator->validate($value, $constraint); @@ -151,7 +150,7 @@ class RegexValidatorTest extends AbstractConstraintValidatorTest // Dropped because of match=false $constraint = new Regex(array( 'pattern' => '/[a-z]+/', - 'match' => false + 'match' => false, )); $this->assertNull($constraint->getHtmlPattern()); } diff --git a/src/Symfony/Component/Validator/Tests/Constraints/TimeValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/TimeValidatorTest.php index 4cc5f028b4..3536a72a25 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/TimeValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/TimeValidatorTest.php @@ -13,7 +13,6 @@ namespace Symfony\Component\Validator\Tests\Constraints; use Symfony\Component\Validator\Constraints\Time; use Symfony\Component\Validator\Constraints\TimeValidator; -use Symfony\Component\Validator\Validation; class TimeValidatorTest extends AbstractConstraintValidatorTest { @@ -76,7 +75,7 @@ class TimeValidatorTest extends AbstractConstraintValidatorTest public function testInvalidTimes($time) { $constraint = new Time(array( - 'message' => 'myMessage' + 'message' => 'myMessage', )); $this->validator->validate($time, $constraint); diff --git a/src/Symfony/Component/Validator/Tests/Constraints/TrueValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/TrueValidatorTest.php index e401b87022..68f207eba2 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/TrueValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/TrueValidatorTest.php @@ -13,7 +13,6 @@ namespace Symfony\Component\Validator\Tests\Constraints; use Symfony\Component\Validator\Constraints\True; use Symfony\Component\Validator\Constraints\TrueValidator; -use Symfony\Component\Validator\Validation; class TrueValidatorTest extends AbstractConstraintValidatorTest { @@ -39,7 +38,7 @@ class TrueValidatorTest extends AbstractConstraintValidatorTest public function testFalseIsInvalid() { $constraint = new True(array( - 'message' => 'myMessage' + 'message' => 'myMessage', )); $this->validator->validate(false, $constraint); diff --git a/src/Symfony/Component/Validator/Tests/Constraints/TypeValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/TypeValidatorTest.php index 1391846387..7a7fcea74e 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/TypeValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/TypeValidatorTest.php @@ -13,7 +13,6 @@ namespace Symfony\Component\Validator\Tests\Constraints; use Symfony\Component\Validator\Constraints\Type; use Symfony\Component\Validator\Constraints\TypeValidator; -use Symfony\Component\Validator\Validation; class TypeValidatorTest extends AbstractConstraintValidatorTest { @@ -113,7 +112,7 @@ class TypeValidatorTest extends AbstractConstraintValidatorTest { $constraint = new Type(array( 'type' => $type, - 'message' => 'myMessage' + 'message' => 'myMessage', )); $this->validator->validate($value, $constraint); diff --git a/src/Symfony/Component/Validator/Tests/Constraints/UrlValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/UrlValidatorTest.php index 0d4e8e3394..353c9acc67 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/UrlValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/UrlValidatorTest.php @@ -114,7 +114,7 @@ class UrlValidatorTest extends AbstractConstraintValidatorTest public function testInvalidUrls($url) { $constraint = new Url(array( - 'message' => 'myMessage' + 'message' => 'myMessage', )); $this->validator->validate($url, $constraint); @@ -155,7 +155,7 @@ class UrlValidatorTest extends AbstractConstraintValidatorTest public function testCustomProtocolIsValid($url) { $constraint = new Url(array( - 'protocols' => array('ftp', 'file', 'git') + 'protocols' => array('ftp', 'file', 'git'), )); $this->validator->validate($url, $constraint); diff --git a/src/Symfony/Component/Validator/Tests/ExecutionContextTest.php b/src/Symfony/Component/Validator/Tests/ExecutionContextTest.php index dcc9c027bf..cf91137e3a 100644 --- a/src/Symfony/Component/Validator/Tests/ExecutionContextTest.php +++ b/src/Symfony/Component/Validator/Tests/ExecutionContextTest.php @@ -284,7 +284,7 @@ class ExecutionContextTest extends \PHPUnit_Framework_TestCase 'foo' => new ConstraintA(), 'bar' => new ConstraintA(), )), - 'name' => new ConstraintA() + 'name' => new ConstraintA(), )); $visitor = new ValidationVisitor('Root', $this->metadataFactory, new ConstraintValidatorFactory(), $this->translator); diff --git a/src/Symfony/Component/Validator/Tests/Fixtures/StubGlobalExecutionContext.php b/src/Symfony/Component/Validator/Tests/Fixtures/StubGlobalExecutionContext.php index bfe096a86d..aa8b74c8b9 100644 --- a/src/Symfony/Component/Validator/Tests/Fixtures/StubGlobalExecutionContext.php +++ b/src/Symfony/Component/Validator/Tests/Fixtures/StubGlobalExecutionContext.php @@ -27,7 +27,7 @@ class StubGlobalExecutionContext implements GlobalExecutionContextInterface private $visitor; - function __construct($root = null, ValidationVisitorInterface $visitor = null) + public function __construct($root = null, ValidationVisitorInterface $visitor = null) { $this->violations = new ConstraintViolationList(); $this->root = $root; diff --git a/src/Symfony/Component/Validator/Tests/Mapping/ElementMetadataTest.php b/src/Symfony/Component/Validator/Tests/Mapping/ElementMetadataTest.php index 8cf3e6dec4..03ec6652b3 100644 --- a/src/Symfony/Component/Validator/Tests/Mapping/ElementMetadataTest.php +++ b/src/Symfony/Component/Validator/Tests/Mapping/ElementMetadataTest.php @@ -70,4 +70,6 @@ class ElementMetadataTest extends \PHPUnit_Framework_TestCase } } -class TestElementMetadata extends ElementMetadata {} +class TestElementMetadata extends ElementMetadata +{ +} diff --git a/src/Symfony/Component/Validator/Tests/ValidationVisitorTest.php b/src/Symfony/Component/Validator/Tests/ValidationVisitorTest.php index f2838737a2..2fe4395c2d 100644 --- a/src/Symfony/Component/Validator/Tests/ValidationVisitorTest.php +++ b/src/Symfony/Component/Validator/Tests/ValidationVisitorTest.php @@ -587,7 +587,7 @@ class ValidationVisitorTest extends \PHPUnit_Framework_TestCase $this->visitor = new ValidationVisitor('Root', $this->metadataFactory, new ConstraintValidatorFactory(), new DefaultTranslator(), null, array( $initializer1, - $initializer2 + $initializer2, )); // prepare constraint which diff --git a/src/Symfony/Component/Validator/Validator.php b/src/Symfony/Component/Validator/Validator.php index 39d886a171..963558d4cd 100644 --- a/src/Symfony/Component/Validator/Validator.php +++ b/src/Symfony/Component/Validator/Validator.php @@ -54,8 +54,7 @@ class Validator implements ValidatorInterface TranslatorInterface $translator, $translationDomain = 'validators', array $objectInitializers = array() - ) - { + ) { $this->metadataFactory = $metadataFactory; $this->validatorFactory = $validatorFactory; $this->translator = $translator; diff --git a/src/Symfony/Component/Yaml/Escaper.php b/src/Symfony/Component/Yaml/Escaper.php index 15a121792f..7f6ec2bef2 100644 --- a/src/Symfony/Component/Yaml/Escaper.php +++ b/src/Symfony/Component/Yaml/Escaper.php @@ -31,13 +31,13 @@ class Escaper "\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f", "\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17", "\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f", - "\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9"); + "\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9",); private static $escaped = array('\\\\', '\\"', '\\\\', '\\"', "\\0", "\\x01", "\\x02", "\\x03", "\\x04", "\\x05", "\\x06", "\\a", "\\b", "\\t", "\\n", "\\v", "\\f", "\\r", "\\x0e", "\\x0f", "\\x10", "\\x11", "\\x12", "\\x13", "\\x14", "\\x15", "\\x16", "\\x17", "\\x18", "\\x19", "\\x1a", "\\e", "\\x1c", "\\x1d", "\\x1e", "\\x1f", - "\\N", "\\_", "\\L", "\\P"); + "\\N", "\\_", "\\L", "\\P",); /** * Determines if a PHP value would require double quoting in YAML. diff --git a/src/Symfony/Component/Yaml/Parser.php b/src/Symfony/Component/Yaml/Parser.php index 5c578e35d3..910db804cd 100644 --- a/src/Symfony/Component/Yaml/Parser.php +++ b/src/Symfony/Component/Yaml/Parser.php @@ -92,7 +92,7 @@ class Parser if (!isset($values['value']) || '' == trim($values['value'], ' ') || 0 === strpos(ltrim($values['value'], ' '), '#')) { $c = $this->getRealCurrentLineNb() + 1; $parser = new Parser($c); - $parser->refs =& $this->refs; + $parser->refs = & $this->refs; $data[] = $parser->parse($this->getNextEmbedBlock(null, true), $exceptionOnInvalidType, $objectSupport); } else { if (isset($values['leadspaces']) @@ -102,7 +102,7 @@ class Parser // this is a compact notation element, add to next block and parse $c = $this->getRealCurrentLineNb(); $parser = new Parser($c); - $parser->refs =& $this->refs; + $parser->refs = & $this->refs; $block = $values['value']; if ($this->isNextLineIndented()) { @@ -145,7 +145,7 @@ class Parser } $c = $this->getRealCurrentLineNb() + 1; $parser = new Parser($c); - $parser->refs =& $this->refs; + $parser->refs = & $this->refs; $parsed = $parser->parse($value, $exceptionOnInvalidType, $objectSupport); $merged = array(); @@ -182,7 +182,7 @@ class Parser } else { $c = $this->getRealCurrentLineNb() + 1; $parser = new Parser($c); - $parser->refs =& $this->refs; + $parser->refs = & $this->refs; $data[$key] = $parser->parse($this->getNextEmbedBlock(), $exceptionOnInvalidType, $objectSupport); } } else { @@ -647,5 +647,4 @@ class Parser { return (0 === strpos($this->currentLine, '- ')); } - } diff --git a/src/Symfony/Component/Yaml/Tests/DumperTest.php b/src/Symfony/Component/Yaml/Tests/DumperTest.php index 53d164c4ba..51e12d41f5 100644 --- a/src/Symfony/Component/Yaml/Tests/DumperTest.php +++ b/src/Symfony/Component/Yaml/Tests/DumperTest.php @@ -55,7 +55,7 @@ class DumperTest extends \PHPUnit_Framework_TestCase { $this->dumper->setIndentation(7); -$expected = <<assertEquals($expected, $this->dumper->dump($this->array, -10), '->dump() takes an inline level argument'); -$this->assertEquals($expected, $this->dumper->dump($this->array, 0), '->dump() takes an inline level argument'); + $this->assertEquals($expected, $this->dumper->dump($this->array, -10), '->dump() takes an inline level argument'); + $this->assertEquals($expected, $this->dumper->dump($this->array, 0), '->dump() takes an inline level argument'); -$expected = << array('foo', array('bar' => 'foo', 'foo' => array('foo', array('bar' => 'foo'))), array('foo', array('bar' => 'foo'))), '[foo, bar: { foo: bar }]' => array('foo', '1' => array('bar' => array('foo' => 'bar'))), - '[foo, \'@foo.baz\', { \'%foo%\': \'foo is %foo%\', bar: \'%foo%\' }, true, \'@service_container\']' => array('foo', '@foo.baz', array('%foo%' => 'foo is %foo%', 'bar' => '%foo%',), true, '@service_container',), + '[foo, \'@foo.baz\', { \'%foo%\': \'foo is %foo%\', bar: \'%foo%\' }, true, \'@service_container\']' => array('foo', '@foo.baz', array('%foo%' => 'foo is %foo%', 'bar' => '%foo%'), true, '@service_container'), ); } @@ -276,7 +276,7 @@ class InlineTest extends \PHPUnit_Framework_TestCase '[foo, { bar: foo, foo: [foo, { bar: foo }] }, [foo, { bar: foo }]]' => array('foo', array('bar' => 'foo', 'foo' => array('foo', array('bar' => 'foo'))), array('foo', array('bar' => 'foo'))), - '[foo, \'@foo.baz\', { \'%foo%\': \'foo is %foo%\', bar: \'%foo%\' }, true, \'@service_container\']' => array('foo', '@foo.baz', array('%foo%' => 'foo is %foo%', 'bar' => '%foo%',), true, '@service_container',), + '[foo, \'@foo.baz\', { \'%foo%\': \'foo is %foo%\', bar: \'%foo%\' }, true, \'@service_container\']' => array('foo', '@foo.baz', array('%foo%' => 'foo is %foo%', 'bar' => '%foo%'), true, '@service_container'), ); } } diff --git a/src/Symfony/Component/Yaml/Tests/ParserTest.php b/src/Symfony/Component/Yaml/Tests/ParserTest.php index 01c7b53995..e5492f846f 100644 --- a/src/Symfony/Component/Yaml/Tests/ParserTest.php +++ b/src/Symfony/Component/Yaml/Tests/ParserTest.php @@ -405,7 +405,7 @@ foo: |- EOF; $expected = array( - 'foo' => "\n\nbar" + 'foo' => "\n\nbar", ); $this->assertSame($expected, $this->parser->parse($yaml)); @@ -449,7 +449,7 @@ 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", "CP1252", "cp1252: '©ÉÇáñ'"), ); foreach ($yamls as $yaml) { @@ -458,7 +458,7 @@ EOF; $this->fail('charsets other than UTF-8 are rejected.'); } catch (\Exception $e) { - $this->assertInstanceOf('Symfony\Component\Yaml\Exception\ParseException', $e, 'charsets other than UTF-8 are rejected.'); + $this->assertInstanceOf('Symfony\Component\Yaml\Exception\ParseException', $e, 'charsets other than UTF-8 are rejected.'); } } } diff --git a/src/Symfony/Component/Yaml/Unescaper.php b/src/Symfony/Component/Yaml/Unescaper.php index b47d4a5928..50b1018c40 100644 --- a/src/Symfony/Component/Yaml/Unescaper.php +++ b/src/Symfony/Component/Yaml/Unescaper.php @@ -130,12 +130,12 @@ class Unescaper return chr($c); } if (0x800 > $c) { - return chr(0xC0 | $c>>6).chr(0x80 | $c & 0x3F); + return chr(0xC0 | $c >> 6).chr(0x80 | $c & 0x3F); } if (0x10000 > $c) { - return chr(0xE0 | $c>>12).chr(0x80 | $c>>6 & 0x3F).chr(0x80 | $c & 0x3F); + return chr(0xE0 | $c >> 12).chr(0x80 | $c >> 6 & 0x3F).chr(0x80 | $c & 0x3F); } - return chr(0xF0 | $c>>18).chr(0x80 | $c>>12 & 0x3F).chr(0x80 | $c>>6 & 0x3F).chr(0x80 | $c & 0x3F); + return chr(0xF0 | $c >> 18).chr(0x80 | $c >> 12 & 0x3F).chr(0x80 | $c >> 6 & 0x3F).chr(0x80 | $c & 0x3F); } }