Skip to content

Commit b85f70e

Browse files
Merge branch '3.4' into 4.0
* 3.4: [HttpKernel] fix PHP 5.4 compat Fix surrogate not using original request [Finder] Update RealIteratorTestCase [Routing] remove unneeded dev dep on doctrine/common [minor] SCA [Validator] Remove BOM in some xlf files Fix symfony#27378: Error when rendering a DateIntervalType form with exactly 0 weeks [HttpKernel] fix session tracking in surrogate master requests
2 parents 57fc15b + 917b07a commit b85f70e

File tree

25 files changed

+166
-41
lines changed

25 files changed

+166
-41
lines changed

src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/DoctrineExtensionTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,7 @@ public function testLoadBasicCacheDriver(string $class, array $config, array $ex
204204
$definition = $container->getDefinition('doctrine.orm.default_metadata_cache');
205205
$defCalls = $definition->getMethodCalls();
206206
$expectedCalls[] = 'setNamespace';
207-
$actualCalls = array_map(function ($call) {
208-
return $call[0];
209-
}, $defCalls);
207+
$actualCalls = array_column($defCalls, 0);
210208

211209
$this->assertFalse($definition->isPublic());
212210
$this->assertEquals("%$class%", $definition->getClass());

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ protected function describeContainerDefinition(Definition $definition, array $op
311311
$tableRows[] = array('Autoconfigured', $definition->isAutoconfigured() ? 'yes' : 'no');
312312

313313
if ($definition->getFile()) {
314-
$tableRows[] = array('Required File', $definition->getFile() ? $definition->getFile() : '-');
314+
$tableRows[] = array('Required File', $definition->getFile() ?: '-');
315315
}
316316

317317
if ($factory = $definition->getFactory()) {

src/Symfony/Bundle/SecurityBundle/Tests/Functional/UserPasswordEncoderCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function testEncodePasswordArgon2i()
8686
$this->assertContains('Password encoding succeeded', $output);
8787

8888
$encoder = new Argon2iPasswordEncoder();
89-
preg_match('# Encoded password\s+(\$argon2id?\$[\w\d,=\$+\/]+={0,2})\s+#', $output, $matches);
89+
preg_match('# Encoded password\s+(\$argon2id?\$[\w,=\$+\/]+={0,2})\s+#', $output, $matches);
9090
$hash = $matches[1];
9191
$this->assertTrue($encoder->isPasswordValid($hash, 'password', null));
9292
}

src/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public function testProcessInlinesWhenThereAreMultipleReferencesButFromTheSameDe
126126
public function testYamlContainerCompiles($directory, $actualServiceId, $expectedServiceId, ContainerBuilder $mainContainer = null)
127127
{
128128
// allow a container to be passed in, which might have autoconfigure settings
129-
$container = $mainContainer ? $mainContainer : new ContainerBuilder();
129+
$container = $mainContainer ?: new ContainerBuilder();
130130
$container->setResourceTracking(false);
131131
$loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Fixtures/yaml/integration/'.$directory));
132132
$loader->load('main.yml');

src/Symfony/Component/Finder/Tests/Iterator/RealIteratorTestCase.php

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,20 @@ public static function setUpBeforeClass()
6060

6161
public static function tearDownAfterClass()
6262
{
63-
foreach (array_reverse(self::$files) as $file) {
64-
if (DIRECTORY_SEPARATOR === $file[strlen($file) - 1]) {
65-
@rmdir($file);
63+
$paths = new \RecursiveIteratorIterator(
64+
new \RecursiveDirectoryIterator(self::$tmpDir, \RecursiveDirectoryIterator::SKIP_DOTS),
65+
\RecursiveIteratorIterator::CHILD_FIRST
66+
);
67+
68+
foreach ($paths as $path) {
69+
if ($path->isDir()) {
70+
if ($path->isLink()) {
71+
@unlink($path);
72+
} else {
73+
@rmdir($path);
74+
}
6675
} else {
67-
@unlink($file);
76+
@unlink($path);
6877
}
6978
}
7079
}

src/Symfony/Component/Form/Extension/Core/DataTransformer/DateIntervalToArrayTransformer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function transform($dateInterval)
8989
$result[$field] = $dateInterval->format('%'.($this->pad ? strtoupper($char) : $char));
9090
}
9191
if (in_array('weeks', $this->fields, true)) {
92-
$result['weeks'] = 0;
92+
$result['weeks'] = '0';
9393
if (isset($result['days']) && (int) $result['days'] >= 7) {
9494
$result['weeks'] = (string) floor($result['days'] / 7);
9595
$result['days'] = (string) ($result['days'] % 7);

src/Symfony/Component/Form/Resources/translations/validators.hy.xlf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0"?>
1+
<?xml version="1.0"?>
22
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
33
<file source-language="en" datatype="plaintext" original="file.ext">
44
<body>
@@ -16,4 +16,4 @@
1616
</trans-unit>
1717
</body>
1818
</file>
19-
</xliff>
19+
</xliff>

src/Symfony/Component/Form/Resources/translations/validators.lt.xlf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0"?>
1+
<?xml version="1.0"?>
22
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
33
<file source-language="en" datatype="plaintext" original="file.ext">
44
<body>
@@ -16,4 +16,4 @@
1616
</trans-unit>
1717
</body>
1818
</file>
19-
</xliff>
19+
</xliff>

src/Symfony/Component/Form/Resources/translations/validators.mn.xlf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0"?>
1+
<?xml version="1.0"?>
22
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
33
<file source-language="en" datatype="plaintext" original="file.ext">
44
<body>

src/Symfony/Component/Form/Resources/translations/validators.ru.xlf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0"?>
1+
<?xml version="1.0"?>
22
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
33
<file source-language="en" datatype="plaintext" original="file.ext">
44
<body>
@@ -16,4 +16,4 @@
1616
</trans-unit>
1717
</body>
1818
</file>
19-
</xliff>
19+
</xliff>

0 commit comments

Comments
 (0)