Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 47da664

Browse filesBrowse files
Merge branch '5.2' into 5.x
* 5.2: Allow psr/cache v3 but on symfony/cache [DI] fix tracking of changes to vendor/ dirs Remove EOLed 5.1 branch from PR template [HttpKernel] [Kernel] Silence deprecations logs writes Update PULL_REQUEST_TEMPLATE.md fix typo [Mailer][Mime] Update inline part names with newly generated ContentId Fixed updating catalogue metadata from intl domain [HttpFoundation] Setting `REQUEST_TIME_FLOAT` when constructing a Request object
2 parents 66a1a8b + 382b10f commit 47da664
Copy full SHA for 47da664

File tree

20 files changed

+101
-38
lines changed
Filter options

20 files changed

+101
-38
lines changed

‎.github/PULL_REQUEST_TEMPLATE.md

Copy file name to clipboardExpand all lines: .github/PULL_REQUEST_TEMPLATE.md
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
| Q | A
22
| ------------- | ---
3-
| Branch? | 5.x for features / 4.4, 5.1 or 5.2 for bug fixes <!-- see below -->
3+
| Branch? | 5.x for features / 4.4 or 5.2 for bug fixes <!-- see below -->
44
| Bug fix? | yes/no
55
| New feature? | yes/no <!-- please update src/**/CHANGELOG.md files -->
66
| Deprecations? | yes/no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
@@ -17,4 +17,5 @@ Additionally (see https://symfony.com/releases):
1717
- Bug fixes must be submitted against the lowest maintained branch where they apply
1818
(lowest branches are regularly merged to upper ones so they get the fixes too.)
1919
- Features and deprecations must be submitted against branch 5.x.
20+
- Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
2021
-->

‎src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,11 @@ private function filterCatalogue(MessageCatalogue $catalogue, string $domain): M
334334
foreach ($catalogue->getResources() as $resource) {
335335
$filteredCatalogue->addResource($resource);
336336
}
337+
if ($metadata = $catalogue->getMetadata('', $intlDomain)) {
338+
foreach ($metadata as $k => $v) {
339+
$filteredCatalogue->setMetadata($k, $v, $intlDomain);
340+
}
341+
}
337342
if ($metadata = $catalogue->getMetadata('', $domain)) {
338343
foreach ($metadata as $k => $v) {
339344
$filteredCatalogue->setMetadata($k, $v, $domain);

‎src/Symfony/Component/DependencyInjection/ContainerBuilder.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/ContainerBuilder.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1599,14 +1599,14 @@ private function getExpressionLanguage(): ExpressionLanguage
15991599
private function inVendors(string $path): bool
16001600
{
16011601
if (null === $this->vendors) {
1602-
$resource = new ComposerResource();
1603-
$this->vendors = $resource->getVendors();
1604-
$this->addResource($resource);
1602+
$this->vendors = (new ComposerResource())->getVendors();
16051603
}
16061604
$path = realpath($path) ?: $path;
16071605

16081606
foreach ($this->vendors as $vendor) {
16091607
if (0 === strpos($path, $vendor) && false !== strpbrk(substr($path, \strlen($vendor), 1), '/'.\DIRECTORY_SEPARATOR)) {
1608+
$this->addResource(new FileResource($vendor.'/composer/installed.json'));
1609+
16101610
return true;
16111611
}
16121612
}

‎src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/ContainerBuilderTest.php
+4-6Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
use PHPUnit\Framework\TestCase;
1919
use Psr\Container\ContainerInterface as PsrContainerInterface;
2020
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
21-
use Symfony\Component\Config\Resource\ComposerResource;
2221
use Symfony\Component\Config\Resource\DirectoryResource;
2322
use Symfony\Component\Config\Resource\FileResource;
2423
use Symfony\Component\Config\Resource\ResourceInterface;
@@ -952,7 +951,7 @@ public function testAddObjectResource()
952951

953952
$resources = $container->getResources();
954953

955-
$this->assertCount(2, $resources, '2 resources were registered');
954+
$this->assertCount(1, $resources);
956955

957956
/* @var $resource \Symfony\Component\Config\Resource\FileResource */
958957
$resource = end($resources);
@@ -981,9 +980,9 @@ public function testGetReflectionClass()
981980

982981
$resources = $container->getResources();
983982

984-
$this->assertCount(3, $resources, '3 resources were registered');
983+
$this->assertCount(2, $resources);
985984

986-
$this->assertSame('reflection.BarClass', (string) $resources[1]);
985+
$this->assertSame('reflection.BarClass', (string) $resources[0]);
987986
$this->assertSame('BarMissingClass', (string) end($resources));
988987
}
989988

@@ -1044,7 +1043,6 @@ public function testResources()
10441043
public function testFileExists()
10451044
{
10461045
$container = new ContainerBuilder();
1047-
$A = new ComposerResource();
10481046
$a = new FileResource(__DIR__.'/Fixtures/xml/services1.xml');
10491047
$b = new FileResource(__DIR__.'/Fixtures/xml/services2.xml');
10501048
$c = new DirectoryResource($dir = \dirname($b));
@@ -1058,7 +1056,7 @@ public function testFileExists()
10581056
}
10591057
}
10601058

1061-
$this->assertEquals([$A, $a, $b, $c], $resources, '->getResources() returns an array of resources read for the current configuration');
1059+
$this->assertEquals([$a, $b, $c], $resources, '->getResources() returns an array of resources read for the current configuration');
10621060
}
10631061

10641062
public function testExtension()

‎src/Symfony/Component/DependencyInjection/Tests/Loader/GlobFileLoaderTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Tests/Loader/GlobFileLoaderTest.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function testLoadAddsTheGlobResourceToTheContainer()
3232
$loader = new GlobFileLoaderWithoutImport($container = new ContainerBuilder(), new FileLocator());
3333
$loader->load(__DIR__.'/../Fixtures/config/*');
3434

35-
$this->assertEquals(new GlobResource(__DIR__.'/../Fixtures/config', '/*', false), $container->getResources()[1]);
35+
$this->assertEquals(new GlobResource(__DIR__.'/../Fixtures/config', '/*', false), $container->getResources()[0]);
3636
}
3737
}
3838

‎src/Symfony/Component/HttpFoundation/Request.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Request.php
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ public static function create(string $uri, string $method = 'GET', array $parame
347347
'SCRIPT_FILENAME' => '',
348348
'SERVER_PROTOCOL' => 'HTTP/1.1',
349349
'REQUEST_TIME' => time(),
350+
'REQUEST_TIME_FLOAT' => microtime(true),
350351
], $server);
351352

352353
$server['PATH_INFO'] = '';

‎src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MarshallingSessionHandler.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Session/Storage/Handler/MarshallingSessionHandler.php
+8-8Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,47 +28,47 @@ public function __construct(AbstractSessionHandler $handler, MarshallerInterface
2828
}
2929

3030
/**
31-
* {@inheritdoc}
31+
* @return bool
3232
*/
3333
public function open($savePath, $name)
3434
{
3535
return $this->handler->open($savePath, $name);
3636
}
3737

3838
/**
39-
* {@inheritdoc}
39+
* @return bool
4040
*/
4141
public function close()
4242
{
4343
return $this->handler->close();
4444
}
4545

4646
/**
47-
* {@inheritdoc}
47+
* @return bool
4848
*/
4949
public function destroy($sessionId)
5050
{
5151
return $this->handler->destroy($sessionId);
5252
}
5353

5454
/**
55-
* {@inheritdoc}
55+
* @return bool
5656
*/
5757
public function gc($maxlifetime)
5858
{
5959
return $this->handler->gc($maxlifetime);
6060
}
6161

6262
/**
63-
* {@inheritdoc}
63+
* @return string
6464
*/
6565
public function read($sessionId)
6666
{
6767
return $this->marshaller->unmarshall($this->handler->read($sessionId));
6868
}
6969

7070
/**
71-
* {@inheritdoc}
71+
* @return bool
7272
*/
7373
public function write($sessionId, $data)
7474
{
@@ -83,15 +83,15 @@ public function write($sessionId, $data)
8383
}
8484

8585
/**
86-
* {@inheritdoc}
86+
* @return bool
8787
*/
8888
public function validateId($sessionId)
8989
{
9090
return $this->handler->validateId($sessionId);
9191
}
9292

9393
/**
94-
* {@inheritdoc}
94+
* @return bool
9595
*/
9696
public function updateTimestamp($sessionId, $data)
9797
{

‎src/Symfony/Component/HttpKernel/Kernel.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/Kernel.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,8 @@ protected function initializeContainer()
543543
if ($collectDeprecations) {
544544
restore_error_handler();
545545

546-
file_put_contents($buildDir.'/'.$class.'Deprecations.log', serialize(array_values($collectedLogs)));
547-
file_put_contents($buildDir.'/'.$class.'Compiler.log', null !== $container ? implode("\n", $container->getCompiler()->getLog()) : '');
546+
@file_put_contents($buildDir.'/'.$class.'Deprecations.log', serialize(array_values($collectedLogs)));
547+
@file_put_contents($buildDir.'/'.$class.'Compiler.log', null !== $container ? implode("\n", $container->getCompiler()->getLog()) : '');
548548
}
549549
}
550550

‎src/Symfony/Component/HttpKernel/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpKernel/composer.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"symfony/stopwatch": "^4.4|^5.0",
4242
"symfony/translation": "^4.4|^5.0",
4343
"symfony/translation-contracts": "^1.1|^2",
44-
"psr/cache": "^1.0|^2.0",
44+
"psr/cache": "^1.0|^2.0|^3.0",
4545
"twig/twig": "^2.13|^3.0.4"
4646
},
4747
"provide": {

‎src/Symfony/Component/Lock/Tests/Store/RetryTillSaveStoreTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Lock/Tests/Store/RetryTillSaveStoreTest.php
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
/**
1919
* @author Jérémy Derussé <jeremy@derusse.com>
20+
*
21+
* @group legacy
2022
*/
2123
class RetryTillSaveStoreTest extends AbstractStoreTest
2224
{

‎src/Symfony/Component/Messenger/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Component/Messenger/composer.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"symfony/redis-messenger": "^5.1"
2626
},
2727
"require-dev": {
28-
"psr/cache": "^1.0|^2.0",
28+
"psr/cache": "^1.0|^2.0|^3.0",
2929
"symfony/console": "^4.4|^5.0",
3030
"symfony/dependency-injection": "^4.4|^5.0",
3131
"symfony/event-dispatcher": "^4.4|^5.0",

‎src/Symfony/Component/Mime/Email.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mime/Email.php
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,7 @@ private function prepareParts(): ?array
485485
$attachment['inline'] = true;
486486
$inlineParts[$name] = $part = $this->createDataPart($attachment);
487487
$html = str_replace('cid:'.$name, 'cid:'.$part->getContentId(), $html);
488+
$part->setName($part->getContentId());
488489
continue 2;
489490
}
490491
$attachmentParts[] = $this->createDataPart($attachment);

‎src/Symfony/Component/RateLimiter/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Component/RateLimiter/composer.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"symfony/options-resolver": "^5.1"
2222
},
2323
"require-dev": {
24-
"psr/cache": "^1.0|^2.0"
24+
"psr/cache": "^1.0|^2.0|^3.0"
2525
},
2626
"autoload": {
2727
"psr-4": { "Symfony\\Component\\RateLimiter\\": "" },

‎src/Symfony/Component/Security/Core/Authentication/Token/NullToken.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Authentication/Token/NullToken.php
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,17 @@ public function __unserialize(array $data): void
9494
{
9595
}
9696

97+
/**
98+
* @return string
99+
*/
97100
public function serialize()
98101
{
99102
return '';
100103
}
101104

105+
/**
106+
* @return void
107+
*/
102108
public function unserialize($serialized)
103109
{
104110
}

‎src/Symfony/Component/Translation/Catalogue/MergeOperation.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Translation/Catalogue/MergeOperation.php
+8-6Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,21 @@ protected function processDomain(string $domain)
3838

3939
foreach ($this->source->all($domain) as $id => $message) {
4040
$this->messages[$domain]['all'][$id] = $message;
41-
$this->result->add([$id => $message], $this->source->defines($id, $intlDomain) ? $intlDomain : $domain);
42-
if (null !== $keyMetadata = $this->source->getMetadata($id, $domain)) {
43-
$this->result->setMetadata($id, $keyMetadata, $domain);
41+
$d = $this->source->defines($id, $intlDomain) ? $intlDomain : $domain;
42+
$this->result->add([$id => $message], $d);
43+
if (null !== $keyMetadata = $this->source->getMetadata($id, $d)) {
44+
$this->result->setMetadata($id, $keyMetadata, $d);
4445
}
4546
}
4647

4748
foreach ($this->target->all($domain) as $id => $message) {
4849
if (!$this->source->has($id, $domain)) {
4950
$this->messages[$domain]['all'][$id] = $message;
5051
$this->messages[$domain]['new'][$id] = $message;
51-
$this->result->add([$id => $message], $this->target->defines($id, $intlDomain) ? $intlDomain : $domain);
52-
if (null !== $keyMetadata = $this->target->getMetadata($id, $domain)) {
53-
$this->result->setMetadata($id, $keyMetadata, $domain);
52+
$d = $this->target->defines($id, $intlDomain) ? $intlDomain : $domain;
53+
$this->result->add([$id => $message], $d);
54+
if (null !== $keyMetadata = $this->target->getMetadata($id, $d)) {
55+
$this->result->setMetadata($id, $keyMetadata, $d);
5456
}
5557
}
5658
}

‎src/Symfony/Component/Translation/Catalogue/TargetOperation.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Translation/Catalogue/TargetOperation.php
+8-6Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ protected function processDomain(string $domain)
4949
foreach ($this->source->all($domain) as $id => $message) {
5050
if ($this->target->has($id, $domain)) {
5151
$this->messages[$domain]['all'][$id] = $message;
52-
$this->result->add([$id => $message], $this->target->defines($id, $intlDomain) ? $intlDomain : $domain);
53-
if (null !== $keyMetadata = $this->source->getMetadata($id, $domain)) {
54-
$this->result->setMetadata($id, $keyMetadata, $domain);
52+
$d = $this->target->defines($id, $intlDomain) ? $intlDomain : $domain;
53+
$this->result->add([$id => $message], $d);
54+
if (null !== $keyMetadata = $this->source->getMetadata($id, $d)) {
55+
$this->result->setMetadata($id, $keyMetadata, $d);
5556
}
5657
} else {
5758
$this->messages[$domain]['obsolete'][$id] = $message;
@@ -62,9 +63,10 @@ protected function processDomain(string $domain)
6263
if (!$this->source->has($id, $domain)) {
6364
$this->messages[$domain]['all'][$id] = $message;
6465
$this->messages[$domain]['new'][$id] = $message;
65-
$this->result->add([$id => $message], $this->target->defines($id, $intlDomain) ? $intlDomain : $domain);
66-
if (null !== $keyMetadata = $this->target->getMetadata($id, $domain)) {
67-
$this->result->setMetadata($id, $keyMetadata, $domain);
66+
$d = $this->target->defines($id, $intlDomain) ? $intlDomain : $domain;
67+
$this->result->add([$id => $message], $d);
68+
if (null !== $keyMetadata = $this->target->getMetadata($id, $d)) {
69+
$this->result->setMetadata($id, $keyMetadata, $d);
6870
}
6971
}
7072
}

‎src/Symfony/Component/Translation/Tests/Catalogue/MergeOperationTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Translation/Tests/Catalogue/MergeOperationTest.php
+23Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,29 @@ public function testGetResultWithMetadata()
9090
);
9191
}
9292

93+
public function testGetResultWithMetadataFromIntlDomain()
94+
{
95+
$leftCatalogue = new MessageCatalogue('en', ['messages+intl-icu' => ['a' => 'old_a', 'b' => 'old_b']]);
96+
$leftCatalogue->setMetadata('a', 'foo', 'messages+intl-icu');
97+
$leftCatalogue->setMetadata('b', 'bar', 'messages+intl-icu');
98+
$rightCatalogue = new MessageCatalogue('en', ['messages+intl-icu' => ['b' => 'new_b', 'c' => 'new_c']]);
99+
$rightCatalogue->setMetadata('b', 'baz', 'messages+intl-icu');
100+
$rightCatalogue->setMetadata('c', 'qux', 'messages+intl-icu');
101+
102+
$mergedCatalogue = new MessageCatalogue('en', ['messages+intl-icu' => ['a' => 'old_a', 'b' => 'old_b', 'c' => 'new_c']]);
103+
$mergedCatalogue->setMetadata('a', 'foo', 'messages+intl-icu');
104+
$mergedCatalogue->setMetadata('b', 'bar', 'messages+intl-icu');
105+
$mergedCatalogue->setMetadata('c', 'qux', 'messages+intl-icu');
106+
107+
$this->assertEquals(
108+
$mergedCatalogue,
109+
$this->createOperation(
110+
$leftCatalogue,
111+
$rightCatalogue
112+
)->getResult()
113+
);
114+
}
115+
93116
protected function createOperation(MessageCatalogueInterface $source, MessageCatalogueInterface $target)
94117
{
95118
return new MergeOperation($source, $target);

‎src/Symfony/Component/Translation/Tests/Catalogue/TargetOperationTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Translation/Tests/Catalogue/TargetOperationTest.php
+22Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,28 @@ public function testGetResultWithMetadata()
102102
);
103103
}
104104

105+
public function testGetResultWithMetadataFromIntlDomain()
106+
{
107+
$leftCatalogue = new MessageCatalogue('en', ['messages+intl-icu' => ['a' => 'old_a', 'b' => 'old_b']]);
108+
$leftCatalogue->setMetadata('a', 'foo', 'messages+intl-icu');
109+
$leftCatalogue->setMetadata('b', 'bar', 'messages+intl-icu');
110+
$rightCatalogue = new MessageCatalogue('en', ['messages+intl-icu' => ['b' => 'new_b', 'c' => 'new_c']]);
111+
$rightCatalogue->setMetadata('b', 'baz', 'messages+intl-icu');
112+
$rightCatalogue->setMetadata('c', 'qux', 'messages+intl-icu');
113+
114+
$diffCatalogue = new MessageCatalogue('en', ['messages+intl-icu' => ['b' => 'old_b', 'c' => 'new_c']]);
115+
$diffCatalogue->setMetadata('b', 'bar', 'messages+intl-icu');
116+
$diffCatalogue->setMetadata('c', 'qux', 'messages+intl-icu');
117+
118+
$this->assertEquals(
119+
$diffCatalogue,
120+
$this->createOperation(
121+
$leftCatalogue,
122+
$rightCatalogue
123+
)->getResult()
124+
);
125+
}
126+
105127
protected function createOperation(MessageCatalogueInterface $source, MessageCatalogueInterface $target)
106128
{
107129
return new TargetOperation($source, $target);

‎src/Symfony/Contracts/Cache/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Contracts/Cache/composer.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
],
1818
"require": {
1919
"php": ">=7.2.5",
20-
"psr/cache": "^1.0|^2.0"
20+
"psr/cache": "^1.0|^2.0|^3.0"
2121
},
2222
"suggest": {
2323
"symfony/cache-implementation": ""

‎src/Symfony/Contracts/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Contracts/composer.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
],
1818
"require": {
1919
"php": ">=7.2.5",
20-
"psr/cache": "^1.0|^2.0",
20+
"psr/cache": "^1.0|^2.0|^3.0",
2121
"psr/container": "^1.0",
2222
"psr/event-dispatcher": "^1.0"
2323
},

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.