Merge branch '2.4' into 2.5

* 2.4:
  fixed CS
  [Process] fixed some volatile tests
  [HttpKernel] fixed a volatile test
  [HttpFoundation] fixed some volatile tests
  [Tests] PHPUnit Optimizations
  Use getPathname() instead of string casting to get BinaryFileReponse file path

Conflicts:
	src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/full.php
	src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/SessionController.php
	src/Symfony/Component/ClassLoader/Tests/ApcUniversalClassLoaderTest.php
	src/Symfony/Component/Console/Formatter/OutputFormatterStyle.php
	src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php
	src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php
	src/Symfony/Component/HttpKernel/Tests/DataCollector/LoggerDataCollectorTest.php
	src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php
	src/Symfony/Component/HttpKernel/Tests/Debug/TraceableEventDispatcherTest.php
	src/Symfony/Component/Process/Tests/AbstractProcessTest.php
	src/Symfony/Component/Routing/Matcher/Dumper/PhpMatcherDumper.php
	src/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php
	src/Symfony/Component/Security/Acl/Dbal/MutableAclProvider.php
	src/Symfony/Component/Security/Core/Authentication/Provider/PreAuthenticatedAuthenticationProvider.php
	src/Symfony/Component/Security/Http/Tests/Firewall/SwitchUserListenerTest.php
	src/Symfony/Component/Serializer/Tests/Normalizer/GetSetMethodNormalizerTest.php
	src/Symfony/Component/Translation/Tests/Dumper/IcuResFileDumperTest.php
	src/Symfony/Component/Validator/Constraints/ChoiceValidator.php
	src/Symfony/Component/Validator/Constraints/CollectionValidator.php
	src/Symfony/Component/Validator/Tests/Constraints/AbstractConstraintValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/IsbnValidatorTest.php
	src/Symfony/Component/Validator/Tests/ValidationVisitorTest.php
	src/Symfony/Component/Yaml/Parser.php
This commit is contained in:
Fabien Potencier 2014-09-22 11:14:18 +02:00
commit b91866f6c1
442 changed files with 1223 additions and 1231 deletions

View File

@ -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);
@ -321,7 +321,7 @@ abstract class AbstractDoctrineExtension extends Extension
*/
protected function loadCacheDriver($cacheName, $objectManagerName, array $cacheDriver, ContainerBuilder $container)
{
$cacheDriverServiceId = $this->getObjectManagerElementName($objectManagerName . '_' . $cacheName);
$cacheDriverServiceId = $this->getObjectManagerElementName($objectManagerName.'_'.$cacheName);
switch ($cacheDriver['type']) {
case 'service':
@ -336,7 +336,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', $objectManagerName)), $memcacheInstance);
$cacheDef->addMethodCall('setMemcache', array(new Reference($this->getObjectManagerElementName(sprintf('%s_memcache_instance', $objectManagerName)))));
@ -349,7 +349,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', $objectManagerName)), $memcachedInstance);
$cacheDef->addMethodCall('setMemcached', array(new Reference($this->getObjectManagerElementName(sprintf('%s_memcached_instance', $objectManagerName)))));
@ -362,7 +362,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', $objectManagerName)), $redisInstance);
$cacheDef->addMethodCall('setRedis', array(new Reference($this->getObjectManagerElementName(sprintf('%s_redis_instance', $objectManagerName)))));

View File

@ -456,7 +456,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?'
);
}

View File

@ -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']
));

View File

@ -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)";

View File

@ -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);
}
}

View File

@ -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."
);
}

View File

@ -39,7 +39,7 @@ class DoctrineDataCollectorTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(0, $c->getQueryCount());
$queries = array(
array('sql' => "SELECT * FROM table1", 'params' => array(), 'types' => array(), 'executionMS' => 0)
array('sql' => "SELECT * FROM table1", 'params' => array(), 'types' => array(), 'executionMS' => 0),
);
$c = $this->createCollector($queries);
$c->collect(new Request(), new Response());
@ -53,7 +53,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());
@ -61,7 +61,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());
@ -74,7 +74,7 @@ class DoctrineDataCollectorTest extends \PHPUnit_Framework_TestCase
public function testCollectQueries($param, $types, $expected, $explainable)
{
$queries = array(
array('sql' => "SELECT * FROM table1 WHERE field1 = ?1", 'params' => array($param), 'types' => $types, 'executionMS' => 1)
array('sql' => "SELECT * FROM table1 WHERE field1 = ?1", 'params' => array($param), 'types' => $types, 'executionMS' => 1),
);
$c = $this->createCollector($queries);
$c->collect(new Request(), new Response());
@ -90,7 +90,7 @@ class DoctrineDataCollectorTest extends \PHPUnit_Framework_TestCase
public function testSerialization($param, $types, $expected, $explainable)
{
$queries = array(
array('sql' => "SELECT * FROM table1 WHERE field1 = ?1", 'params' => array($param), 'types' => $types, 'executionMS' => 1)
array('sql' => "SELECT * FROM table1 WHERE field1 = ?1", 'params' => array($param), 'types' => $types, 'executionMS' => 1),
);
$c = $this->createCollector($queries);
$c->collect(new Request(), new Response());

View File

@ -74,7 +74,7 @@ class DoctrineExtensionTest extends \PHPUnit_Framework_TestCase
$cacheName = 'metadata_cache';
$objectManager = array(
'name' => 'default',
'metadata_cache_driver' => $config
'metadata_cache_driver' => $config,
);
$this->invokeLoadCacheDriver($objectManager, $container, $cacheName);
@ -105,8 +105,8 @@ class DoctrineExtensionTest extends \PHPUnit_Framework_TestCase
'name' => 'default',
'metadata_cache_driver' => array(
'type' => 'service',
'id' => 'service_driver'
)
'id' => 'service_driver',
),
);
$container->setDefinition('service_driver', $definition);
@ -127,8 +127,8 @@ class DoctrineExtensionTest extends \PHPUnit_Framework_TestCase
$objectManager = array(
'name' => 'default',
'metadata_cache_driver' => array(
'type' => 'unrecognized_type'
)
'type' => 'unrecognized_type',
),
);
$this->invokeLoadCacheDriver($objectManager, $container, $cacheName);

View File

@ -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());
}

View File

@ -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);
}
}

View File

@ -44,7 +44,7 @@ class EntityTypePerformanceTest extends FormPerformanceTestCase
return array(
new CoreExtension(),
new DoctrineOrmExtension($manager)
new DoctrineOrmExtension($manager),
);
}

View File

@ -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',
));
}

View File

@ -138,5 +138,4 @@ class DbalLoggerTest extends \PHPUnit_Framework_TestCase
'long' => $longString,
));
}
}

View File

@ -69,7 +69,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));
@ -106,7 +106,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
);
}

View File

@ -42,7 +42,6 @@ class ChromePhpHandler extends BaseChromePhpHandler
}
if (!preg_match('{\bChrome/\d+[\.\d+]*\b}', $event->getRequest()->headers->get('User-Agent'))) {
$this->sendHeaders = false;
$this->headers = array();

View File

@ -52,7 +52,7 @@ class ConsoleHandler extends AbstractProcessingHandler implements EventSubscribe
OutputInterface::VERBOSITY_NORMAL => Logger::WARNING,
OutputInterface::VERBOSITY_VERBOSE => Logger::NOTICE,
OutputInterface::VERBOSITY_VERY_VERBOSE => Logger::INFO,
OutputInterface::VERBOSITY_DEBUG => Logger::DEBUG
OutputInterface::VERBOSITY_DEBUG => Logger::DEBUG,
);
/**

View File

@ -43,7 +43,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();

View File

@ -70,10 +70,10 @@ class ConsoleHandlerTest extends \PHPUnit_Framework_TestCase
array(OutputInterface::VERBOSITY_DEBUG, Logger::DEBUG, true),
array(OutputInterface::VERBOSITY_DEBUG, Logger::EMERGENCY, true),
array(OutputInterface::VERBOSITY_NORMAL, Logger::NOTICE, true, array(
OutputInterface::VERBOSITY_NORMAL => Logger::NOTICE
OutputInterface::VERBOSITY_NORMAL => Logger::NOTICE,
)),
array(OutputInterface::VERBOSITY_DEBUG, Logger::NOTICE, true, array(
OutputInterface::VERBOSITY_NORMAL => Logger::NOTICE
OutputInterface::VERBOSITY_NORMAL => Logger::NOTICE,
)),
);
}

View File

@ -24,7 +24,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();

View File

@ -22,7 +22,6 @@ use Symfony\Component\Form\FormEvent;
*/
class TranslationCollectionFormListener implements EventSubscriberInterface
{
private $i18nClass;
private $languages;

View File

@ -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);

View File

@ -26,7 +26,7 @@ class PropelExtension extends AbstractExtension
return array(
new Type\ModelType(PropertyAccess::createPropertyAccessor()),
new Type\TranslationCollectionType(),
new Type\TranslationType()
new Type\TranslationType(),
);
}

View File

@ -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,
),
));
}
}

View File

@ -48,7 +48,7 @@ class TranslationType extends AbstractType
{
$resolver->setRequired(array(
'data_class',
'columns'
'columns',
));
}
}

View File

@ -40,9 +40,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());
}
@ -62,20 +62,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());

View File

@ -124,7 +124,7 @@ class ItemQuery
return array(
$mainAuthorRelation,
$authorRelation,
$resellerRelation
$resellerRelation,
);
}
}

View File

@ -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;
}

View File

@ -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());
}

View File

@ -102,4 +102,6 @@ class CollectionToArrayTransformerTest extends Propel1TestCase
}
}
class DummyObject {}
class DummyObject
{
}

View File

@ -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,
),
));
}
}

View File

@ -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;

View File

@ -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
*/
@ -195,5 +194,4 @@ class stdClass_c1d194250ee2e2b7d2eab8b8212368a8 extends \stdClass implements \Pr
{
return $this->valueHolder5157dd96e88c0;
}
}

View File

@ -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),
);

View File

@ -132,6 +132,7 @@ EOF
$twig->setLoader($realLoader);
} catch (\Twig_Error $e) {
$twig->setLoader($realLoader);
return array('template' => $template, 'file' => $file, 'valid' => false, 'exception' => $e);
}

View File

@ -35,6 +35,5 @@ class FormThemeNode extends \Twig_Node
->raw(', ')
->subcompile($this->getNode('resources'))
->raw(");\n");
;
}
}

View File

@ -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(', ');

View File

@ -53,7 +53,7 @@ class CodeExtensionTest extends \PHPUnit_Framework_TestCase
array('F\Q\N\Foo::Method', '<abbr title="F\Q\N\Foo">Foo</abbr>::Method()'),
array('Bare::Method', '<abbr title="Bare">Bare</abbr>::Method()'),
array('Closure', '<abbr title="Closure">Closure</abbr>'),
array('Method', '<abbr title="Method">Method</abbr>()')
array('Method', '<abbr title="Method">Method</abbr>()'),
);
}

View File

@ -194,14 +194,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')),
);
}
}

View File

@ -87,17 +87,17 @@ class TranslationExtensionTest extends \PHPUnit_Framework_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'),

View File

@ -20,7 +20,7 @@ class FormThemeTest extends \PHPUnit_Framework_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);
@ -36,7 +36,7 @@ class FormThemeTest extends \PHPUnit_Framework_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);

View File

@ -42,7 +42,7 @@ class FormThemeTokenParserTest extends \PHPUnit_Framework_TestCase
), 1),
1,
'form_theme'
)
),
),
array(
'{% form_theme form "tpl1" "tpl2" %}',
@ -52,11 +52,11 @@ class FormThemeTokenParserTest extends \PHPUnit_Framework_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" %}',
@ -65,7 +65,7 @@ class FormThemeTokenParserTest extends \PHPUnit_Framework_TestCase
new \Twig_Node_Expression_Constant('tpl1', 1),
1,
'form_theme'
)
),
),
array(
'{% form_theme form with ["tpl1"] %}',
@ -77,7 +77,7 @@ class FormThemeTokenParserTest extends \PHPUnit_Framework_TestCase
), 1),
1,
'form_theme'
)
),
),
array(
'{% form_theme form with ["tpl1", "tpl2"] %}',
@ -87,11 +87,11 @@ class FormThemeTokenParserTest extends \PHPUnit_Framework_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'
)
),
),
);
}

View File

@ -59,7 +59,7 @@ class TranslationUpdateCommand extends ContainerAwareCommand
new InputOption(
'clean', null, InputOption::VALUE_NONE,
'Should clean not found messages'
)
),
))
->setDescription('Updates the translation file')
->setHelp(<<<EOF

View File

@ -212,7 +212,7 @@ class MarkdownDescriptor extends Descriptor
*/
protected function describeContainerParameter($parameter, array $options = array())
{
$this->write(isset($options['parameter']) ? sprintf("%s\n%s\n\n%s", $options['parameter'], str_repeat('=', strlen($options['parameter'])), $this->formatParameter($parameter)): $parameter);
$this->write(isset($options['parameter']) ? sprintf("%s\n%s\n\n%s", $options['parameter'], str_repeat('=', strlen($options['parameter'])), $this->formatParameter($parameter)) : $parameter);
}
private function formatRouterConfig(array $array)

View File

@ -90,7 +90,7 @@ class Router extends BaseRouter implements WarmableInterface
}
foreach ($route->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,

View File

@ -53,5 +53,4 @@ class TemplateFinderTest extends TestCase
$this->assertContains('::this.is.a.template.format.engine', $templates);
$this->assertContains('::resource.format.engine', $templates);
}
}

View File

@ -135,7 +135,7 @@ abstract class AbstractDescriptorTest extends \PHPUnit_Framework_TestCase
'services' => array('show_private' => true),
'public' => array('show_private' => false),
'tag1' => array('show_private' => true, 'tag' => 'tag1'),
'tags' => array('group_by' => 'tags', 'show_private' => true)
'tags' => array('group_by' => 'tags', 'show_private' => true),
);
$data = array();

View File

@ -72,7 +72,7 @@ class ObjectsProvider
$builder->setParameter('database_name', 'symfony');
return array(
'parameter' => $builder
'parameter' => $builder,
);
}

View File

@ -60,7 +60,7 @@ class RedirectControllerTest extends TestCase
'route' => $route,
'permanent' => $permanent,
'additional-parameter' => 'value',
'ignoreAttributes' => $ignoreAttributes
'ignoreAttributes' => $ignoreAttributes,
),
);

View File

@ -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();

View File

@ -91,5 +91,4 @@ class AddConsoleCommandPassTest extends \PHPUnit_Framework_TestCase
class MyCommand extends Command
{
}

View File

@ -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');

View File

@ -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);
}

View File

@ -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'),
),
));
}
@ -137,8 +137,8 @@ class ConfigurationTest extends \PHPUnit_Framework_TestCase
'debug' => '%kernel.debug%',
),
'serializer' => array(
'enabled' => false
)
'enabled' => false,
),
);
}
}

View File

@ -13,5 +13,4 @@ namespace Symfony\Bundle\FrameworkBundle\Tests;
class TestBundle extends \Symfony\Component\HttpKernel\Bundle\Bundle
{
}

View File

@ -3,7 +3,7 @@
$container->loadFromExtension('framework', array(
'csrf_protection' => array(
'enabled' => true,
'field_name' => '_custom'
'field_name' => '_custom',
),
'form' => array(
'enabled' => true,

View File

@ -3,12 +3,12 @@
$container->loadFromExtension('framework', array(
'csrf_protection' => array(
'enabled' => true,
'field_name' => '_custom'
'field_name' => '_custom',
),
'form' => array(
'enabled' => true,
'csrf_protection' => array(
'field_name' => '_custom_form'
'field_name' => '_custom_form',
),
),
'session' => array(

View File

@ -54,7 +54,7 @@ $container->loadFromExtension('framework', array(
),
),
'form' => array(
'resources' => array('theme1', 'theme2')
'resources' => array('theme1', 'theme2'),
),
'hinclude_default_template' => 'global_hinclude_template',
),
@ -78,7 +78,7 @@ $container->loadFromExtension('framework', array(
'text/csv',
'text/plain',
),
'pdf' => 'application/pdf'
)
)
'pdf' => 'application/pdf',
),
),
));

View File

@ -18,7 +18,7 @@ use Symfony\Component\DependencyInjection\ContainerAware;
class SessionController extends ContainerAware
{
public function welcomeAction(Request $request, $name=null)
public function welcomeAction(Request $request, $name = null)
{
$session = $request->getSession();

View File

@ -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',

View File

@ -19,7 +19,7 @@ class DelegatingEngineTest extends \PHPUnit_Framework_TestCase
{
$container = $this->getContainerMock(array(
'engine.first' => $this->getEngineMock('template.php', false),
'engine.second' => $this->getEngineMock('template.php', true)
'engine.second' => $this->getEngineMock('template.php', true),
));
$delegatingEngine = new DelegatingEngine($container, array('engine.first', 'engine.second'));
@ -33,7 +33,7 @@ class DelegatingEngineTest extends \PHPUnit_Framework_TestCase
$secondEngine = $this->getEngineMock('template.php', true);
$container = $this->getContainerMock(array(
'engine.first' => $firstEngine,
'engine.second' => $secondEngine
'engine.second' => $secondEngine,
));
$delegatingEngine = new DelegatingEngine($container, array('engine.first', 'engine.second'));
@ -51,7 +51,7 @@ class DelegatingEngineTest extends \PHPUnit_Framework_TestCase
$secondEngine = $this->getEngineMock('template.php', false);
$container = $this->getContainerMock(array(
'engine.first' => $firstEngine,
'engine.second' => $secondEngine
'engine.second' => $secondEngine,
));
$delegatingEngine = new DelegatingEngine($container, array('engine.first', 'engine.second'));

View File

@ -112,14 +112,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')),
);
}
}

View File

@ -1,2 +1,4 @@
<?php if (!$label) { $label = $view['form']->humanize($name); } ?>
<?php if (!$label) {
$label = $view['form']->humanize($name);
} ?>
<label>Custom label: <?php echo $view->escape($view['translator']->trans($label, array(), $translation_domain)) ?></label>

View File

@ -175,7 +175,6 @@ class TranslatorTest extends \PHPUnit_Framework_TestCase
$this->assertSame('en-US', $translator->getLocale());
}
protected function getCatalogue($locale, $messages)
{
$catalogue = new MessageCatalogue($locale);

View File

@ -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(

View File

@ -341,11 +341,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()
@ -402,8 +402,8 @@ class MainConfiguration implements ConfigurationInterface
'Acme\DemoBundle\Entity\User2' => array(
'algorithm' => 'sha512',
'encode_as_base64' => 'true',
'iterations'=> 5000
)
'iterations' => 5000,
),
))
->requiresAtLeastOneElement()
->useAttributeAsKey('class')

View File

@ -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']),
));
}

View File

@ -144,7 +144,7 @@ class SecurityExtension extends Extension
->addTag('doctrine.event_listener', array(
'connection' => $config['connection'],
'event' => 'postGenerateSchema',
'lazy' => true
'lazy' => true,
))
;

View File

@ -5,5 +5,5 @@ $this->load('container1.php', $container);
$container->loadFromExtension('security', array(
'acl' => array(
'provider' => 'foo',
)
),
));

View File

@ -16,5 +16,5 @@ $container->loadFromExtension('security', array(
'role_hierarchy' => array(
'FOO' => array('MOO'),
)
),
));

View File

@ -5,8 +5,8 @@ $container->loadFromExtension('security', array(
'main' => array(
'form_login' => array(
'login_path' => '/login',
)
)
),
),
),
'role_hierarchy' => array(
'FOO' => 'BAR',

View File

@ -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();

View File

@ -96,22 +96,22 @@ class SecurityRoutingIntegrationTest extends WebTestCase
*/
public function testSecurityConfigurationForExpression($config)
{
$allowedClient = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array('HTTP_USER_AGENT' => 'Firefox 1.0'));
$this->assertAllowed($allowedClient, '/protected-via-expression');
$allowedClient = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array('HTTP_USER_AGENT' => 'Firefox 1.0'));
$this->assertAllowed($allowedClient, '/protected-via-expression');
$barredClient = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array());
$this->assertRestricted($barredClient, '/protected-via-expression');
$barredClient = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array());
$this->assertRestricted($barredClient, '/protected-via-expression');
$allowedClient = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array());
$allowedClient = $this->createClient(array('test_case' => 'StandardFormLogin', 'root_config' => $config), array());
$allowedClient->request('GET', '/protected-via-expression');
$form = $allowedClient->followRedirect()->selectButton('login')->form();
$form['_username'] = 'johannes';
$form['_password'] = 'test';
$allowedClient->submit($form);
$this->assertRedirect($allowedClient->getResponse(), '/protected-via-expression');
$this->assertAllowed($allowedClient, '/protected-via-expression');
}
$allowedClient->request('GET', '/protected-via-expression');
$form = $allowedClient->followRedirect()->selectButton('login')->form();
$form['_username'] = 'johannes';
$form['_password'] = 'test';
$allowedClient->submit($form);
$this->assertRedirect($allowedClient->getResponse(), '/protected-via-expression');
$this->assertAllowed($allowedClient, '/protected-via-expression');
}
private function assertAllowed($client, $path)
{

View File

@ -77,7 +77,7 @@ EOF
$items = array();
foreach ($twig->{'get'.ucfirst($type)}() as $name => $entity) {
if (!$filter || false !== strpos($name, $filter)) {
$items[$name] = $name . $this->getPrettyMetadata($type, $entity);
$items[$name] = $name.$this->getPrettyMetadata($type, $entity);
}
}
@ -87,7 +87,7 @@ EOF
if ($index > 0) {
$output->writeln('');
}
$output->writeln('<info>' . ucfirst($type) . '</info>');
$output->writeln('<info>'.ucfirst($type).'</info>');
ksort($items);
foreach ($items as $item) {
$output->writeln(' '.$item);
@ -138,7 +138,7 @@ EOF
// format args
$args = array_map(function ($param) {
if ($param->isDefaultValueAvailable()) {
return $param->getName() . ' = ' . json_encode($param->getDefaultValue());
return $param->getName().' = '.json_encode($param->getDefaultValue());
}
return $param->getName();
@ -165,7 +165,7 @@ EOF
return '(unknown?)';
}
} catch (\UnexpectedValueException $e) {
return ' <error>' . $e->getMessage() . '</error>';
return ' <error>'.$e->getMessage().'</error>';
}
if ($type === 'globals') {
@ -177,11 +177,11 @@ EOF
}
if ($type === 'functions') {
return '(' . implode(', ', $meta) . ')';
return '('.implode(', ', $meta).')';
}
if ($type === 'filters') {
return $meta ? '(' . implode(', ', $meta) . ')' : '';
return $meta ? '('.implode(', ', $meta).')' : '';
}
}
}

View File

@ -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],
);
}
}

View File

@ -4,7 +4,7 @@ $container->loadFromExtension('twig', array(
'form' => array(
'resources' => array(
'MyBundle::form.html.twig',
)
),
),
'globals' => array(
'foo' => '@bar',

View File

@ -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'
)
),
),
);
}

View File

@ -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'));
}

View File

@ -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

View File

@ -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

View File

@ -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);

View File

@ -466,7 +466,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();
@ -600,7 +600,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'));

View File

@ -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);

View File

@ -71,7 +71,6 @@ class ClassMapGenerator
foreach ($classes as $class) {
$map[$class] = $path;
}
}
return $map;

View File

@ -32,7 +32,7 @@ class Psr4ClassLoader
public function addPrefix($prefix, $baseDir)
{
$prefix = trim($prefix, '\\').'\\';
$baseDir = rtrim($baseDir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
$baseDir = rtrim($baseDir, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;
$this->prefixes[] = array($prefix, $baseDir);
}
@ -49,7 +49,7 @@ class Psr4ClassLoader
list($currentPrefix, $currentBaseDir) = $current;
if (0 === strpos($class, $currentPrefix)) {
$classWithoutPrefix = substr($class, strlen($currentPrefix));
$file = $currentBaseDir . str_replace('\\', DIRECTORY_SEPARATOR, $classWithoutPrefix) . '.php';
$file = $currentBaseDir.str_replace('\\', DIRECTORY_SEPARATOR, $classWithoutPrefix).'.php';
if (file_exists($file)) {
return $file;
}

View File

@ -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.',
),
);
}
}
}

View File

@ -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',

View File

@ -2,4 +2,6 @@
namespace ClassesWithParents;
class A extends B {}
class A extends B
{
}

View File

@ -2,4 +2,6 @@
namespace ClassesWithParents;
class B implements CInterface {}
class B implements CInterface
{
}

View File

@ -13,5 +13,4 @@ namespace ClassMap;
class SomeClass extends SomeParent implements SomeInterface
{
}

View File

@ -13,5 +13,4 @@ namespace ClassMap;
interface SomeInterface
{
}

View File

@ -13,5 +13,4 @@ namespace ClassMap;
abstract class SomeParent
{
}

View File

@ -1,14 +1,24 @@
<?php
namespace {
class A {}
class A
{
}
}
namespace Alpha {
class A {}
class B {}
class A
{
}
class B
{
}
}
namespace Beta {
class A {}
class B {}
class A
{
}
class B
{
}
}

View File

@ -11,5 +11,9 @@
namespace Foo\Bar;
class A {}
class B {}
class A
{
}
class B
{
}

View File

@ -1,7 +1,8 @@
<?php
trait TD
{}
{
}
trait TZ
{

View File

@ -25,6 +25,7 @@ namespace Foo {
class CBar implements IBar
{
use TBar, TFooBar;
use TBar;
use TFooBar;
}
}

View File

@ -24,7 +24,7 @@ class Psr4ClassLoaderTest extends \PHPUnit_Framework_TestCase
$loader = new Psr4ClassLoader();
$loader->addPrefix(
'Acme\\DemoLib',
__DIR__ . DIRECTORY_SEPARATOR . 'Fixtures' . DIRECTORY_SEPARATOR . 'psr-4'
__DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'psr-4'
);
$loader->loadClass($className);
$this->assertTrue(class_exists($className), sprintf('loadClass() should load %s', $className));
@ -39,7 +39,7 @@ class Psr4ClassLoaderTest extends \PHPUnit_Framework_TestCase
array('Acme\\DemoLib\\Foo'),
array('Acme\\DemoLib\\Class_With_Underscores'),
array('Acme\\DemoLib\\Lets\\Go\\Deeper\\Foo'),
array('Acme\\DemoLib\\Lets\\Go\\Deeper\\Class_With_Underscores')
array('Acme\\DemoLib\\Lets\\Go\\Deeper\\Class_With_Underscores'),
);
}
@ -52,7 +52,7 @@ class Psr4ClassLoaderTest extends \PHPUnit_Framework_TestCase
$loader = new Psr4ClassLoader();
$loader->addPrefix(
'Acme\\DemoLib',
__DIR__ . DIRECTORY_SEPARATOR . 'Fixtures' . DIRECTORY_SEPARATOR . 'psr-4'
__DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.'psr-4'
);
$loader->loadClass($className);
$this->assertFalse(class_exists($className), sprintf('loadClass() should not load %s', $className));
@ -65,7 +65,7 @@ class Psr4ClassLoaderTest extends \PHPUnit_Framework_TestCase
{
return array(
array('Acme\\DemoLib\\I_Do_Not_Exist'),
array('UnknownVendor\\SomeLib\\I_Do_Not_Exist')
array('UnknownVendor\\SomeLib\\I_Do_Not_Exist'),
);
}
}

View File

@ -287,7 +287,6 @@ class UniversalClassLoader
return $file;
}
}
} else {
// PEAR-like class name
$normalizedClass = str_replace('_', DIRECTORY_SEPARATOR, $class).'.php';

View File

@ -123,5 +123,4 @@ class ConfigCache
{
return $this->file.'.meta';
}
}

View File

@ -39,5 +39,4 @@ class BooleanNodeDefinition extends ScalarNodeDefinition
{
return new BooleanNode($this->name, $this->parent);
}
}

View File

@ -243,5 +243,4 @@ class NodeBuilder implements NodeParentInterface
return $class;
}
}

Some files were not shown because too many files have changed in this diff Show More