Skip to content

Commit e03e868

Browse files
committed
Merge branch '7.1' into 7.2
* 7.1: (31 commits) [Serializer] Remove useless calls to `func_get_arg()` fix tests using Twig 3.12 skip tests requiring the intl extension if it's not installed 🐛 throw ParseException on invalid date [FrameworkBundle] Re-remove redundant name attribute from `default_context` fix permitted data type of the default choice [ExpressionLanguage] Improve test coverage Fix invalid phpdoc in ContainerBuilder [HttpKernel] [WebProfileBundle] Fix Routing panel for URLs with a colon [Form] NumberType: Fix parsing of numbers in exponential notation with negative exponent Fix importing PHP config in prepend extension method [Messenger] Prevent waiting time to overflow when using long delays [Security] consistent singular/plural translation in Dutch reset the validation context after validating nested constraints do not duplicate directory separators fix handling empty data in ValueToDuplicatesTransformer fix compatibility with redis extension 6.0.3+ synchronize unsupported scheme tests [String] Fixed Quorum plural, that was inflected to be only "Quora" and never "Quorums" Fix symfony/kaz-info-teh-notifier package ...
2 parents 44be5f1 + 2bacd10 commit e03e868

File tree

47 files changed

+549
-72
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+549
-72
lines changed

CHANGELOG-7.0.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,34 @@ in 7.0 minor versions.
77
To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash
88
To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v7.0.0...v7.0.1
99

10+
* 7.0.10 (2024-07-26)
11+
12+
* bug #57803 [FrameworkBundle] move adding detailed JSON error messages to the validate phase (xabbuh)
13+
* bug #57815 [Console][PhpUnitBridge][VarDumper] Fix `NO_COLOR` empty value handling (alexandre-daubois)
14+
* bug #57828 [Translation] Fix CSV escape char in `CsvFileLoader` on PHP >= 7.4 (alexandre-daubois)
15+
* bug #57812 [Validator] treat uninitialized properties referenced by property paths as null (xabbuh)
16+
* bug #57816 [DoctrineBridge] fix messenger bus dispatch inside an active transaction (IndraGunawan)
17+
* bug #57799 [ErrorHandler][VarDumper] Remove PHP 8.4 deprecations (alexandre-daubois)
18+
* bug #57772 [WebProfilerBundle] Add word wrap in tables in dialog to see all the text in workflow listeners dialog (SpartakusMd)
19+
* bug #57802 [PropertyInfo] Fix nullable value returned from extractFromMutator on CollectionType (benjilebon)
20+
* bug #57832 [DependencyInjection] Do not try to load default method name on interface (lyrixx)
21+
* bug #57748 [SecurityBundle] use firewall-specific user checkers when manually logging in users (xabbuh)
22+
* bug #57753 [ErrorHandler] restrict the maximum length of the X-Debug-Exception header (xabbuh)
23+
* bug #57646 [Serializer] Raise correct exception in `ArrayDenormalizer` when called without a nested denormalizer (derrabus)
24+
* bug #57674 [Cache] Improve `dbindex` DSN parameter parsing (constantable)
25+
* bug #57678 [Validator] Add `setGroupProvider` to `AttributeLoader` (Maximilian Zumbansen)
26+
* bug #57679 [WebProfilerBundle] Change incorrect check for the `stateless` request attribute (themasch)
27+
* bug #57663 [Cache] use copy() instead of rename() on Windows (xabbuh)
28+
* bug #57617 [PropertyInfo] Handle collection in PhpStan same as PhpDoc (mtarld)
29+
* bug #54057 [Messenger] Passing actual `Envelope` to `WorkerMessageRetriedEvent` (daffoxdev)
30+
* bug #57645 [Routing] Discard in-memory cache of routes when writing the file-based cache (mpdude)
31+
* bug #57621 [Mailer]  force HTTP 1.1 for Mailgun API requests (xabbuh)
32+
* bug #57616 [String] Revert "Fixed u()->snake(), b()->snake() and s()->snake() methods" (nicolas-grekas)
33+
* bug #57593 [SecurityBundle] Compare paths after realpath() has been applied to both (xabbuh)
34+
* bug #57594 [String] Normalize underscores in snake() (xabbuh)
35+
* bug #57585 [HttpFoundation] Fix MockArraySessionStorage to generate more conform ids (Seldaek)
36+
* bug #57589 [FrameworkBundle] fix AssetMapper usage without assets enabled (xabbuh)
37+
1038
* 7.0.9 (2024-06-28)
1139

1240
* bug #57345 [DependencyInjection] Fix regression in ordering service locators by priority (longwave)

src/Symfony/Bridge/Twig/Tests/Extension/HttpKernelExtensionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function testGenerateFragmentUri()
7070
'index' => \sprintf(<<<TWIG
7171
{{ fragment_uri(controller("%s::templateAction", {template: "foo.html.twig"})) }}
7272
TWIG
73-
, TemplateController::class), ]);
73+
, str_replace('\\', '\\\\', TemplateController::class)), ]);
7474
$twig = new Environment($loader, ['debug' => true, 'cache' => false]);
7575
$twig->addExtension(new HttpKernelExtension());
7676

@@ -80,7 +80,7 @@ public function testGenerateFragmentUri()
8080
]);
8181
$twig->addRuntimeLoader($loader);
8282

83-
$this->assertSame('/_fragment?_hash=PP8%2FeEbn1pr27I9wmag%2FM6jYGVwUZ0l2h0vhh2OJ6CI%3D&amp;_path=template%3Dfoo.html.twig%26_format%3Dhtml%26_locale%3Den%26_controller%3DSymfonyBundleFrameworkBundleControllerTemplateController%253A%253AtemplateAction', $twig->render('index'));
83+
$this->assertSame('/_fragment?_hash=XCg0hX8QzSwik8Xuu9aMXhoCeI4oJOob7lUVacyOtyY%3D&amp;_path=template%3Dfoo.html.twig%26_format%3Dhtml%26_locale%3Den%26_controller%3DSymfony%255CBundle%255CFrameworkBundle%255CController%255CTemplateController%253A%253AtemplateAction', $twig->render('index'));
8484
}
8585

8686
protected function getFragmentHandler($returnOrException): FragmentHandler

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1118,7 +1118,6 @@ private function addSerializerSection(ArrayNodeDefinition $rootNode, callable $e
11181118
->end()
11191119
->arrayNode('default_context')
11201120
->normalizeKeys(false)
1121-
->useAttributeAsKey('name')
11221121
->validate()
11231122
->ifTrue(fn () => $this->debug && class_exists(JsonParser::class))
11241123
->then(fn (array $v) => $v + [JsonDecode::DETAILED_ERROR_MESSAGES => true])

src/Symfony/Bundle/WebProfilerBundle/Controller/RouterController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ public function panelAction(string $token): Response
7979
*/
8080
private function getTraces(RequestDataCollector $request, string $method): array
8181
{
82-
$traceRequest = Request::create(
83-
$request->getPathInfo(),
84-
$request->getRequestServer(true)->get('REQUEST_METHOD'),
85-
\in_array($request->getMethod(), ['DELETE', 'PATCH', 'POST', 'PUT'], true) ? $request->getRequestRequest()->all() : $request->getRequestQuery()->all(),
82+
$traceRequest = new Request(
83+
$request->getRequestQuery()->all(),
84+
$request->getRequestRequest()->all(),
85+
$request->getRequestAttributes()->all(),
8686
$request->getRequestCookies(true)->all(),
8787
[],
8888
$request->getRequestServer(true)->all()
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Bundle\WebProfilerBundle\Tests\Controller;
13+
14+
use Symfony\Bundle\FrameworkBundle\KernelBrowser;
15+
use Symfony\Bundle\FrameworkBundle\Routing\Router;
16+
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
17+
use Symfony\Bundle\WebProfilerBundle\Tests\Functional\WebProfilerBundleKernel;
18+
use Symfony\Component\DomCrawler\Crawler;
19+
use Symfony\Component\Routing\Route;
20+
21+
class RouterControllerTest extends WebTestCase
22+
{
23+
public function testFalseNegativeTrace()
24+
{
25+
$path = '/foo/bar:123/baz';
26+
27+
$kernel = new WebProfilerBundleKernel();
28+
$client = new KernelBrowser($kernel);
29+
$client->disableReboot();
30+
$client->getKernel()->boot();
31+
32+
/** @var Router $router */
33+
$router = $client->getContainer()->get('router');
34+
$router->getRouteCollection()->add('route1', new Route($path));
35+
36+
$client->request('GET', $path);
37+
38+
$crawler = $client->request('GET', '/_profiler/latest?panel=router&type=request');
39+
40+
$matchedRouteCell = $crawler
41+
->filter('#router-logs .status-success td')
42+
->reduce(function (Crawler $td) use ($path): bool {
43+
return $td->text() === $path;
44+
});
45+
46+
$this->assertSame(1, $matchedRouteCell->count());
47+
}
48+
}

src/Symfony/Component/Cache/Tests/Traits/RedisProxiesTest.php

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,34 @@ public function testRedisProxy($class)
3030
{
3131
$version = version_compare(phpversion('redis'), '6', '>') ? '6' : '5';
3232
$proxy = file_get_contents(\dirname(__DIR__, 2)."/Traits/{$class}{$version}Proxy.php");
33+
$proxy = substr($proxy, 0, 2 + strpos($proxy, '[];'));
3334
$expected = substr($proxy, 0, 2 + strpos($proxy, '}'));
3435
$methods = [];
3536

37+
foreach ((new \ReflectionClass(sprintf('Symfony\Component\Cache\Traits\\%s%dProxy', $class, $version)))->getMethods() as $method) {
38+
if ('reset' === $method->name || method_exists(LazyProxyTrait::class, $method->name)) {
39+
continue;
40+
}
41+
$return = '__construct' === $method->name || $method->getReturnType() instanceof \ReflectionNamedType && 'void' === (string) $method->getReturnType() ? '' : 'return ';
42+
$methods[$method->name] = "\n ".ProxyHelper::exportSignature($method, false, $args)."\n".<<<EOPHP
43+
{
44+
{$return}\$this->initializeLazyObject()->{$method->name}({$args});
45+
}
46+
47+
EOPHP;
48+
}
49+
50+
uksort($methods, 'strnatcmp');
51+
$proxy .= implode('', $methods)."}\n";
52+
53+
$methods = [];
54+
3655
foreach ((new \ReflectionClass($class))->getMethods() as $method) {
3756
if ('reset' === $method->name || method_exists(RedisProxyTrait::class, $method->name)) {
3857
continue;
3958
}
4059
$return = '__construct' === $method->name || $method->getReturnType() instanceof \ReflectionNamedType && 'void' === (string) $method->getReturnType() ? '' : 'return ';
41-
$methods[] = "\n ".ProxyHelper::exportSignature($method, false, $args)."\n".<<<EOPHP
60+
$methods[$method->name] = "\n ".ProxyHelper::exportSignature($method, false, $args)."\n".<<<EOPHP
4261
{
4362
{$return}\$this->initializeLazyObject()->{$method->name}({$args});
4463
}

src/Symfony/Component/Cache/Traits/Redis6Proxy.php

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class_exists(\Symfony\Component\VarExporter\Internal\LazyObjectState::class);
2424
*/
2525
class Redis6Proxy extends \Redis implements ResetInterface, LazyObjectInterface
2626
{
27+
use Redis6ProxyTrait;
2728
use RedisProxyTrait {
2829
resetLazyObject as reset;
2930
}
@@ -223,11 +224,6 @@ public function discard(): \Redis|bool
223224
return $this->initializeLazyObject()->discard(...\func_get_args());
224225
}
225226

226-
public function dump($key): \Redis|string
227-
{
228-
return $this->initializeLazyObject()->dump(...\func_get_args());
229-
}
230-
231227
public function echo($str): \Redis|false|string
232228
{
233229
return $this->initializeLazyObject()->echo(...\func_get_args());
@@ -508,16 +504,6 @@ public function hMset($key, $fieldvals): \Redis|bool
508504
return $this->initializeLazyObject()->hMset(...\func_get_args());
509505
}
510506

511-
public function hRandField($key, $options = null): \Redis|array|string
512-
{
513-
return $this->initializeLazyObject()->hRandField(...\func_get_args());
514-
}
515-
516-
public function hSet($key, $member, $value): \Redis|false|int
517-
{
518-
return $this->initializeLazyObject()->hSet(...\func_get_args());
519-
}
520-
521507
public function hSetNx($key, $field, $value): \Redis|bool
522508
{
523509
return $this->initializeLazyObject()->hSetNx(...\func_get_args());
@@ -648,11 +634,6 @@ public function ltrim($key, $start, $end): \Redis|bool
648634
return $this->initializeLazyObject()->ltrim(...\func_get_args());
649635
}
650636

651-
public function mget($keys): \Redis|array
652-
{
653-
return $this->initializeLazyObject()->mget(...\func_get_args());
654-
}
655-
656637
public function migrate($host, $port, $key, $dstdb, $timeout, $copy = false, $replace = false, #[\SensitiveParameter] $credentials = null): \Redis|bool
657638
{
658639
return $this->initializeLazyObject()->migrate(...\func_get_args());
@@ -863,11 +844,6 @@ public function sPop($key, $count = 0): \Redis|array|false|string
863844
return $this->initializeLazyObject()->sPop(...\func_get_args());
864845
}
865846

866-
public function sRandMember($key, $count = 0): \Redis|array|false|string
867-
{
868-
return $this->initializeLazyObject()->sRandMember(...\func_get_args());
869-
}
870-
871847
public function sUnion($key, ...$other_keys): \Redis|array|false
872848
{
873849
return $this->initializeLazyObject()->sUnion(...\func_get_args());
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Cache\Traits;
13+
14+
if (version_compare(phpversion('redis'), '6.1.0', '>=')) {
15+
/**
16+
* @internal
17+
*/
18+
trait Redis6ProxyTrait
19+
{
20+
public function dump($key): \Redis|string|false
21+
{
22+
return $this->initializeLazyObject()->dump(...\func_get_args());
23+
}
24+
25+
public function hRandField($key, $options = null): \Redis|array|string|false
26+
{
27+
return $this->initializeLazyObject()->hRandField(...\func_get_args());
28+
}
29+
30+
public function hSet($key, $fields_and_vals): \Redis|false|int
31+
{
32+
return $this->initializeLazyObject()->hSet(...\func_get_args());
33+
}
34+
35+
public function mget($keys): \Redis|array|false
36+
{
37+
return $this->initializeLazyObject()->mget(...\func_get_args());
38+
}
39+
40+
public function sRandMember($key, $count = 0): mixed
41+
{
42+
return $this->initializeLazyObject()->sRandMember(...\func_get_args());
43+
}
44+
45+
public function waitaof($numlocal, $numreplicas, $timeout): \Redis|array|false
46+
{
47+
return $this->initializeLazyObject()->waitaof(...\func_get_args());
48+
}
49+
}
50+
} else {
51+
/**
52+
* @internal
53+
*/
54+
trait Redis6ProxyTrait
55+
{
56+
public function dump($key): \Redis|string
57+
{
58+
return $this->initializeLazyObject()->dump(...\func_get_args());
59+
}
60+
61+
public function hRandField($key, $options = null): \Redis|array|string
62+
{
63+
return $this->initializeLazyObject()->hRandField(...\func_get_args());
64+
}
65+
66+
public function hSet($key, $member, $value): \Redis|false|int
67+
{
68+
return $this->initializeLazyObject()->hSet(...\func_get_args());
69+
}
70+
71+
public function mget($keys): \Redis|array
72+
{
73+
return $this->initializeLazyObject()->mget(...\func_get_args());
74+
}
75+
76+
public function sRandMember($key, $count = 0): \Redis|array|false|string
77+
{
78+
return $this->initializeLazyObject()->sRandMember(...\func_get_args());
79+
}
80+
}
81+
}

src/Symfony/Component/Cache/Traits/RedisCluster6Proxy.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class_exists(\Symfony\Component\VarExporter\Internal\LazyObjectState::class);
2424
*/
2525
class RedisCluster6Proxy extends \RedisCluster implements ResetInterface, LazyObjectInterface
2626
{
27+
use RedisCluster6ProxyTrait;
2728
use RedisProxyTrait {
2829
resetLazyObject as reset;
2930
}
@@ -653,11 +654,6 @@ public function pttl($key): \RedisCluster|false|int
653654
return $this->initializeLazyObject()->pttl(...\func_get_args());
654655
}
655656

656-
public function publish($channel, $message): \RedisCluster|bool
657-
{
658-
return $this->initializeLazyObject()->publish(...\func_get_args());
659-
}
660-
661657
public function pubsub($key_or_address, ...$values): mixed
662658
{
663659
return $this->initializeLazyObject()->pubsub(...\func_get_args());
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Cache\Traits;
13+
14+
if (version_compare(phpversion('redis'), '6.1.0', '>')) {
15+
/**
16+
* @internal
17+
*/
18+
trait RedisCluster6ProxyTrait
19+
{
20+
public function getex($key, $options = []): \RedisCluster|string|false
21+
{
22+
return $this->initializeLazyObject()->getex(...\func_get_args());
23+
}
24+
25+
public function publish($channel, $message): \RedisCluster|bool|int
26+
{
27+
return $this->initializeLazyObject()->publish(...\func_get_args());
28+
}
29+
30+
public function waitaof($key_or_address, $numlocal, $numreplicas, $timeout): \RedisCluster|array|false
31+
{
32+
return $this->initializeLazyObject()->waitaof(...\func_get_args());
33+
}
34+
}
35+
} else {
36+
/**
37+
* @internal
38+
*/
39+
trait RedisCluster6ProxyTrait
40+
{
41+
public function publish($channel, $message): \RedisCluster|bool
42+
{
43+
return $this->initializeLazyObject()->publish(...\func_get_args());
44+
}
45+
}
46+
}

0 commit comments

Comments
 (0)