Skip to content

Commit 072db6b

Browse files
committed
Merge branch '6.3' into 6.4
* 6.3: fix merge [VarDumper] Test intl formatter broken since dumper does not replace the nnbsp character by standard space [WebProfilerBundle] Fix intercept external redirects [Webhook] Added missing XML attribute in config XSD [String] Skip a test when an issue is detected in PCRE2 [ExpressionLanguage] Fix null coalescing propagation [Mailer] Stop using the (local) AWS shared configuration in the PHPUnit tests. detect colors on not windows fix xterm detection refactor: hyper check Missing translations for Slovak (sk) symfony#51954 Remove redundant PHPdoc line properly handle SYMFONY_DOTENV_VARS being the empty string Avoid incompatibility with symfony/console 7 bug symfony#45057 [Messenger] Avoid reconnecting active Redis connections. [HttpKernel] Catch `TypeError` if the wrong type is used in `BackedEnumValueResolver` [Serializer] fix regression where nullable int cannot be serialized do not overwrite an application's default serialization context
2 parents b926004 + 1c4feac commit 072db6b

File tree

25 files changed

+246
-47
lines changed

25 files changed

+246
-47
lines changed

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1990,21 +1990,23 @@ private function registerSerializerConfiguration(array $config, ContainerBuilder
19901990
$container->getDefinition('serializer.name_converter.metadata_aware')->setArgument(1, new Reference($config['name_converter']));
19911991
}
19921992

1993+
$defaultContext = $config['default_context'] ?? [];
1994+
1995+
if ($defaultContext) {
1996+
$container->setParameter('serializer.default_context', $defaultContext);
1997+
}
1998+
19931999
if (isset($config['circular_reference_handler']) && $config['circular_reference_handler']) {
19942000
$arguments = $container->getDefinition('serializer.normalizer.object')->getArguments();
1995-
$context = ($arguments[6] ?? []) + ['circular_reference_handler' => new Reference($config['circular_reference_handler'])];
2001+
$context = ($arguments[6] ?? $defaultContext) + ['circular_reference_handler' => new Reference($config['circular_reference_handler'])];
19962002
$container->getDefinition('serializer.normalizer.object')->setArgument(5, null);
19972003
$container->getDefinition('serializer.normalizer.object')->setArgument(6, $context);
19982004
}
19992005

20002006
if ($config['max_depth_handler'] ?? false) {
2001-
$defaultContext = $container->getDefinition('serializer.normalizer.object')->getArgument(6);
2002-
$defaultContext += ['max_depth_handler' => new Reference($config['max_depth_handler'])];
2003-
$container->getDefinition('serializer.normalizer.object')->replaceArgument(6, $defaultContext);
2004-
}
2005-
2006-
if (isset($config['default_context']) && $config['default_context']) {
2007-
$container->setParameter('serializer.default_context', $config['default_context']);
2007+
$arguments = $container->getDefinition('serializer.normalizer.object')->getArguments();
2008+
$context = ($arguments[6] ?? $defaultContext) + ['max_depth_handler' => new Reference($config['max_depth_handler'])];
2009+
$container->getDefinition('serializer.normalizer.object')->setArgument(6, $context);
20082010
}
20092011
}
20102012

src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -979,6 +979,7 @@
979979
<xsd:element name="service" type="xsd:string" minOccurs="0" maxOccurs="1" />
980980
<xsd:element name="secret" type="xsd:string" minOccurs="0" maxOccurs="1" />
981981
</xsd:sequence>
982+
<xsd:attribute name="type" type="xsd:string" use="required" />
982983
</xsd:complexType>
983984

984985
<xsd:complexType name="remote-event">
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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\FrameworkBundle\Tests\Fixtures\Serializer;
13+
14+
class CircularReferenceHandler
15+
{
16+
public function __invoke()
17+
{
18+
}
19+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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\FrameworkBundle\Tests\Fixtures\Serializer;
13+
14+
class MaxDepthHandler
15+
{
16+
public function __invoke()
17+
{
18+
}
19+
}

src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Serializer/config.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ framework:
66
translator: true
77
serializer:
88
enabled: true
9+
circular_reference_handler: Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Serializer\CircularReferenceHandler
10+
max_depth_handler: Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Serializer\MaxDepthHandler
911
default_context:
1012
enable_max_depth: true
1113
fake_context_option: foo
@@ -63,3 +65,7 @@ services:
6365
serializer.encoder.csv.alias:
6466
alias: serializer.encoder.csv
6567
public: true
68+
69+
Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Serializer\CircularReferenceHandler: ~
70+
71+
Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Serializer\MaxDepthHandler: ~

src/Symfony/Bundle/FrameworkBundle/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
"symfony/asset": "<5.4",
8383
"symfony/asset-mapper": "<6.4",
8484
"symfony/clock": "<6.3",
85-
"symfony/console": "<5.4",
85+
"symfony/console": "<5.4|>=7.0",
8686
"symfony/dotenv": "<5.4",
8787
"symfony/dom-crawler": "<6.4",
8888
"symfony/http-client": "<6.3",

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar_redirect.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@
3939
<div class="block-exception">
4040
<h1>Redirection Intercepted</h1>
4141

42-
{% set absolute_url = host in location ? location : host ~ location %}
42+
{% set absolute_url = absolute_url(location) %}
4343
<p>This request redirects to <strong>{{ absolute_url }}</strong></p>
4444

45-
<p><a class="btn" href="{{ location }}">Follow redirect</a></p>
45+
<p><a class="btn" href="{{ absolute_url }}">Follow redirect</a></p>
4646

4747
<p class="sf-redirection-help">
4848
The redirect was intercepted by the Symfony Web Debug toolbar to help debugging.

src/Symfony/Component/Console/Output/StreamOutput.php

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -97,18 +97,17 @@ protected function hasColorSupport(): bool
9797
return false;
9898
}
9999

100-
if ('Hyper' === getenv('TERM_PROGRAM')) {
100+
if (\DIRECTORY_SEPARATOR === '\\'
101+
&& \function_exists('sapi_windows_vt100_support')
102+
&& @sapi_windows_vt100_support($this->stream)
103+
) {
101104
return true;
102105
}
103106

104-
if (\DIRECTORY_SEPARATOR === '\\') {
105-
return (\function_exists('sapi_windows_vt100_support')
106-
&& @sapi_windows_vt100_support($this->stream))
107-
|| false !== getenv('ANSICON')
108-
|| 'ON' === getenv('ConEmuANSI')
109-
|| 'xterm' === getenv('TERM');
110-
}
111-
112-
return stream_isatty($this->stream);
107+
return 'Hyper' === getenv('TERM_PROGRAM')
108+
|| false !== getenv('ANSICON')
109+
|| 'ON' === getenv('ConEmuANSI')
110+
|| str_starts_with((string) getenv('TERM'), 'xterm')
111+
|| stream_isatty($this->stream);
113112
}
114113
}

src/Symfony/Component/DependencyInjection/EnvVarProcessorInterface.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ interface EnvVarProcessorInterface
2323
/**
2424
* Returns the value of the given variable as managed by the current instance.
2525
*
26-
* @param string $prefix The namespace of the variable
2726
* @param string $prefix The namespace of the variable; when the empty string is passed, null values should be kept as is
2827
* @param string $name The name of the variable within the namespace
2928
* @param \Closure(string): mixed $getEnv A closure that allows fetching more env vars

src/Symfony/Component/Dotenv/Command/DebugCommand.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,13 @@ private function getVariables(array $envFiles, ?string $nameFilter): array
151151

152152
private function getAvailableVars(): array
153153
{
154-
$vars = explode(',', $_SERVER['SYMFONY_DOTENV_VARS'] ?? '');
154+
$dotenvVars = $_SERVER['SYMFONY_DOTENV_VARS'] ?? '';
155+
156+
if ('' === $dotenvVars) {
157+
return [];
158+
}
159+
160+
$vars = explode(',', $dotenvVars);
155161
sort($vars);
156162

157163
return $vars;

0 commit comments

Comments
 (0)