Skip to content

Commit a31152d

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: Added 'default' color [HttpFoundation] Reload the session after regenerating its id [HttpFoundation] Add a test case to confirm a bug in session migration [Serializer] Fix ClassMetadata::sleep() [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 [Serializer] Fix Groups tests. Remove duplicate example Remove var not used due to returning early (introduced in 8982c32) [Serializer] Fix Groups PHPDoc Enhance hhvm test skip message fix for legacy asset() with EmptyVersionStrategy [Form] Added upgrade notes for #15061
2 parents d1aa96f + cea4b0c commit a31152d

File tree

6 files changed

+20
-12
lines changed

6 files changed

+20
-12
lines changed

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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ protected function describeContainerDefinition(Definition $definition, array $op
274274
$description[] = sprintf('<comment>Abstract</comment> %s', $definition->isAbstract() ? 'yes' : 'no');
275275

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

280280
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))) {
@@ -807,7 +807,7 @@ private function getValidatorMappingFiles(ContainerBuilder $container)
807807
$bundles = $container->getParameter('kernel.bundles');
808808
foreach ($bundles as $bundle) {
809809
$reflection = new \ReflectionClass($bundle);
810-
$dirname = dirname($reflection->getFilename());
810+
$dirname = dirname($reflection->getFileName());
811811

812812
if (is_file($file = $dirname.'/Resources/config/validation.xml')) {
813813
$files[0][] = realpath($file);
@@ -827,7 +827,15 @@ private function getValidatorMappingFiles(ContainerBuilder $container)
827827
$files[1][] = $file->getRealpath();
828828
}
829829

830+
<<<<<<< HEAD
830831
$container->addResource(new DirectoryResource($dir));
832+
=======
833+
foreach ($container->getParameter('kernel.bundles') as $bundle) {
834+
$reflection = new \ReflectionClass($bundle);
835+
if (is_file($file = dirname($reflection->getFileName()).'/Resources/config/validation.yml')) {
836+
$files[] = realpath($file);
837+
$container->addResource(new FileResource($file));
838+
>>>>>>> 2.6
831839
}
832840
}
833841

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)