Skip to content

Commit cea4b0c

Browse files
committed
Merge branch '2.6' into 2.7
* 2.6: Added 'default' color [HttpFoundation] Reload the session after regenerating its id [HttpFoundation] Add a test case to confirm a bug in session migration [2.6] Static Code Analysis for Components and Bundles [Finder] Command::addAtIndex() fails with Command instance argument [DependencyInjection] Freeze also FrozenParameterBag::remove [Twig][Bridge] replaced `extends` with `use` in bootstrap_3_horizontal_layout.html.twig fix CS fixed CS Add a way to reset the singleton [Security] allow to use `method` in XML configs Remove duplicate example Remove var not used due to returning early (introduced in 8982c32) Enhance hhvm test skip message
2 parents df2a5a8 + 16aa769 commit cea4b0c

File tree

7 files changed

+28
-19
lines changed

7 files changed

+28
-19
lines changed

Command/TranslationDebugCommand.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
118118
// Extract used messages
119119
$extractedCatalogue = new MessageCatalogue($locale);
120120
foreach ($transPaths as $path) {
121-
$path = $path.'views';
121+
$path .= 'views';
122+
122123
if (is_dir($path)) {
123124
$this->getContainer()->get('translation.extractor')->extract($path, $extractedCatalogue);
124125
}
@@ -127,7 +128,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
127128
// Load defined messages
128129
$currentCatalogue = new MessageCatalogue($locale);
129130
foreach ($transPaths as $path) {
130-
$path = $path.'translations';
131+
$path .= 'translations';
131132
if (is_dir($path)) {
132133
$loader->loadMessages($path, $currentCatalogue);
133134
}

Command/TranslationUpdateCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
121121
$extractor = $this->getContainer()->get('translation.extractor');
122122
$extractor->setPrefix($input->getOption('prefix'));
123123
foreach ($transPaths as $path) {
124-
$path = $path.'views';
124+
$path .= 'views';
125125
if (is_dir($path)) {
126126
$extractor->extract($path, $extractedCatalogue);
127127
}
@@ -132,7 +132,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
132132
$output->text('Loading translation files');
133133
$loader = $this->getContainer()->get('translation.loader');
134134
foreach ($transPaths as $path) {
135-
$path = $path.'translations';
135+
$path .= 'translations';
136136
if (is_dir($path)) {
137137
$loader->loadMessages($path, $currentCatalogue);
138138
}
@@ -183,7 +183,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
183183

184184
$bundleTransPath = false;
185185
foreach ($transPaths as $path) {
186-
$path = $path.'translations';
186+
$path .= 'translations';
187187
if (is_dir($path)) {
188188
$bundleTransPath = $path;
189189
}

Console/Descriptor/TextDescriptor.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ protected function describeContainerServices(ContainerBuilder $builder, array $o
174174
$serviceIds = isset($options['tag']) && $options['tag'] ? array_keys($builder->findTaggedServiceIds($options['tag'])) : $builder->getServiceIds();
175175
$maxTags = array();
176176

177-
foreach ($serviceIds as $key => $serviceId) {
177+
foreach ($serviceIds as $key => $serviceId) {
178178
$definition = $this->resolveServiceDefinition($builder, $serviceId);
179179
if ($definition instanceof Definition) {
180180
// filter out private services unless shown explicitly
@@ -212,7 +212,7 @@ protected function describeContainerServices(ContainerBuilder $builder, array $o
212212
foreach ($definition->getTag($showTag) as $key => $tag) {
213213
$tagValues = array();
214214
foreach ($tagsNames as $tagName) {
215-
$tagValues[] = isset($tag[$tagName]) ? $tag[$tagName] : "";
215+
$tagValues[] = isset($tag[$tagName]) ? $tag[$tagName] : '';
216216
}
217217
if (0 === $key) {
218218
$table->addRow(array_merge(array($serviceId), $tagValues, array($definition->getClass())));
@@ -225,10 +225,10 @@ protected function describeContainerServices(ContainerBuilder $builder, array $o
225225
}
226226
} elseif ($definition instanceof Alias) {
227227
$alias = $definition;
228-
$table->addRow(array_merge(array($serviceId, sprintf('alias for "%s"', $alias)), $tagsCount ? array_fill(0, $tagsCount, "") : array()));
228+
$table->addRow(array_merge(array($serviceId, sprintf('alias for "%s"', $alias)), $tagsCount ? array_fill(0, $tagsCount, '') : array()));
229229
} else {
230230
// we have no information (happens with "service_container")
231-
$table->addRow(array_merge(array($serviceId, get_class($definition)), $tagsCount ? array_fill(0, $tagsCount, "") : array()));
231+
$table->addRow(array_merge(array($serviceId, get_class($definition)), $tagsCount ? array_fill(0, $tagsCount, '') : array()));
232232
}
233233
}
234234

@@ -245,7 +245,7 @@ protected function describeContainerDefinition(Definition $definition, array $op
245245
: array();
246246

247247
$description[] = sprintf('<comment>Service Id</comment> %s', isset($options['id']) ? $options['id'] : '-');
248-
$description[] = sprintf('<comment>Class</comment> %s', $definition->getClass() ?: "-");
248+
$description[] = sprintf('<comment>Class</comment> %s', $definition->getClass() ?: '-');
249249

250250
$tags = $definition->getTags();
251251
if (count($tags)) {
@@ -271,7 +271,7 @@ protected function describeContainerDefinition(Definition $definition, array $op
271271
$description[] = sprintf('<comment>Abstract</comment> %s', $definition->isAbstract() ? 'yes' : 'no');
272272

273273
if ($definition->getFile()) {
274-
$description[] = sprintf('<comment>Required File</comment> %s', $definition->getFile() ? $definition->getFile() : '-');
274+
$description[] = sprintf('<comment>Required File</comment> %s', $definition->getFile() ?: '-');
275275
}
276276

277277
if ($definition->getFactoryClass(false)) {

DependencyInjection/FrameworkExtension.php

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -670,22 +670,22 @@ private function registerTranslatorConfiguration(array $config, ContainerBuilder
670670
if (class_exists('Symfony\Component\Validator\Validation')) {
671671
$r = new \ReflectionClass('Symfony\Component\Validator\Validation');
672672

673-
$dirs[] = dirname($r->getFilename()).'/Resources/translations';
673+
$dirs[] = dirname($r->getFileName()).'/Resources/translations';
674674
}
675675
if (class_exists('Symfony\Component\Form\Form')) {
676676
$r = new \ReflectionClass('Symfony\Component\Form\Form');
677677

678-
$dirs[] = dirname($r->getFilename()).'/Resources/translations';
678+
$dirs[] = dirname($r->getFileName()).'/Resources/translations';
679679
}
680680
if (class_exists('Symfony\Component\Security\Core\Exception\AuthenticationException')) {
681681
$r = new \ReflectionClass('Symfony\Component\Security\Core\Exception\AuthenticationException');
682682

683-
$dirs[] = dirname($r->getFilename()).'/../Resources/translations';
683+
$dirs[] = dirname($r->getFileName()).'/../Resources/translations';
684684
}
685685
$overridePath = $container->getParameter('kernel.root_dir').'/Resources/%s/translations';
686686
foreach ($container->getParameter('kernel.bundles') as $bundle => $class) {
687687
$reflection = new \ReflectionClass($class);
688-
if (is_dir($dir = dirname($reflection->getFilename()).'/Resources/translations')) {
688+
if (is_dir($dir = dirname($reflection->getFileName()).'/Resources/translations')) {
689689
$dirs[] = $dir;
690690
}
691691
if (is_dir($dir = sprintf($overridePath, $bundle))) {
@@ -800,7 +800,7 @@ private function getValidatorMappingFiles(ContainerBuilder $container)
800800
$bundles = $container->getParameter('kernel.bundles');
801801
foreach ($bundles as $bundle) {
802802
$reflection = new \ReflectionClass($bundle);
803-
$dirname = dirname($reflection->getFilename());
803+
$dirname = dirname($reflection->getFileName());
804804

805805
if (is_file($file = $dirname.'/Resources/config/validation.xml')) {
806806
$files[0][] = realpath($file);
@@ -820,7 +820,15 @@ private function getValidatorMappingFiles(ContainerBuilder $container)
820820
$files[1][] = $file->getRealpath();
821821
}
822822

823+
<<<<<<< HEAD
823824
$container->addResource(new DirectoryResource($dir));
825+
=======
826+
foreach ($container->getParameter('kernel.bundles') as $bundle) {
827+
$reflection = new \ReflectionClass($bundle);
828+
if (is_file($file = dirname($reflection->getFileName()).'/Resources/config/validation.yml')) {
829+
$files[] = realpath($file);
830+
$container->addResource(new FileResource($file));
831+
>>>>>>> 2.6
824832
}
825833
}
826834

Tests/Command/CacheClearCommand/CacheClearCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ protected function setUp()
2424
{
2525
$this->fs = new Filesystem();
2626
$this->kernel = new TestAppKernel('test', true);
27-
$this->rootDir = sys_get_temp_dir().DIRECTORY_SEPARATOR.uniqid('sf2_cache_');
27+
$this->rootDir = sys_get_temp_dir().DIRECTORY_SEPARATOR.uniqid('sf2_cache_', true);
2828
$this->kernel->setRootDir($this->rootDir);
2929
$this->fs->mkdir($this->rootDir);
3030
}

Tests/Command/TranslationDebugCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function testDebugInvalidDirectory()
9595
protected function setUp()
9696
{
9797
$this->fs = new Filesystem();
98-
$this->translationDir = sys_get_temp_dir().'/'.uniqid('sf2_translation');
98+
$this->translationDir = sys_get_temp_dir().'/'.uniqid('sf2_translation', true);
9999
$this->fs->mkdir($this->translationDir.'/Resources/translations');
100100
$this->fs->mkdir($this->translationDir.'/Resources/views');
101101
}

Tests/Console/Descriptor/AbstractDescriptorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function getDescribeContainerParameterTestData()
112112
{
113113
$data = $this->getDescriptionTestData(ObjectsProvider::getContainerParameter());
114114

115-
array_push($data[0], array('parameter' => 'database_name'));
115+
$data[0][] = array('parameter' => 'database_name');
116116

117117
return $data;
118118
}

0 commit comments

Comments
 (0)