Skip to content

Commit 1484d7c

Browse files
Merge branch '5.4' into 6.0
* 5.4: [WebProfilerBundle] Tweak the colors of the security panel Add a setter on DateTimeNormalizer to change the default context at runtime [FrameworkBundle] Fix default PHP attributes support in validation and serializer configuration when doctrine/annotations is not installed with PHP 8
2 parents 72cebf0 + 599d1c9 commit 1484d7c

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,7 @@ private function addValidationSection(ArrayNodeDefinition $rootNode, callable $e
856856
->{$enableIfStandalone('symfony/validator', Validation::class)}()
857857
->children()
858858
->scalarNode('cache')->end()
859-
->booleanNode('enable_annotations')->{!class_exists(FullStack::class) && $willBeAvailable('doctrine/annotations', Annotation::class, 'symfony/validator') ? 'defaultTrue' : 'defaultFalse'}()->end()
859+
->booleanNode('enable_annotations')->{!class_exists(FullStack::class) ? 'defaultTrue' : 'defaultFalse'}()->end()
860860
->arrayNode('static_method')
861861
->defaultValue(['loadValidatorMetadata'])
862862
->prototype('scalar')->end()
@@ -965,7 +965,7 @@ private function addSerializerSection(ArrayNodeDefinition $rootNode, callable $e
965965
->info('serializer configuration')
966966
->{$enableIfStandalone('symfony/serializer', Serializer::class)}()
967967
->children()
968-
->booleanNode('enable_annotations')->{!class_exists(FullStack::class) && $willBeAvailable('doctrine/annotations', Annotation::class, 'symfony/serializer') ? 'defaultTrue' : 'defaultFalse'}()->end()
968+
->booleanNode('enable_annotations')->{!class_exists(FullStack::class) ? 'defaultTrue' : 'defaultFalse'}()->end()
969969
->scalarNode('name_converter')->end()
970970
->scalarNode('circular_reference_handler')->end()
971971
->scalarNode('max_depth_handler')->end()

src/Symfony/Bundle/SecurityBundle/Resources/views/Collector/security.html.twig

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@
44

55
{% block toolbar %}
66
{% if collector.firewall %}
7-
{% if collector.token %}
8-
{% set is_authenticated = collector.enabled and collector.authenticated %}
9-
{% set color_code = not is_authenticated ? 'yellow' %}
10-
{% else %}
11-
{% set color_code = '' %}
12-
{% endif %}
7+
{% set color_code = collector.enabled and not collector.authenticatorManagerEnabled ? 'yellow' %}
138

149
{% set icon %}
1510
{{ include('@Security/Collector/icon.svg') }}
@@ -36,7 +31,7 @@
3631

3732
<div class="sf-toolbar-info-piece">
3833
<b>Authenticated</b>
39-
<span class="sf-toolbar-status sf-toolbar-status-{{ is_authenticated ? 'green' : 'yellow' }}">{{ is_authenticated ? 'Yes' : 'No' }}</span>
34+
<span class="sf-toolbar-status sf-toolbar-status-{{ collector.authenticated ? 'green' : 'yellow' }}">{{ collector.authenticated ? 'Yes' : 'No' }}</span>
4035
</div>
4136

4237
<div class="sf-toolbar-info-piece">

src/Symfony/Component/Serializer/Normalizer/DateTimeNormalizer.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ class DateTimeNormalizer implements NormalizerInterface, DenormalizerInterface,
3838
];
3939

4040
public function __construct(array $defaultContext = [])
41+
{
42+
$this->setDefaultContext($defaultContext);
43+
}
44+
45+
public function setDefaultContext(array $defaultContext): void
4146
{
4247
$this->defaultContext = array_merge($this->defaultContext, $defaultContext);
4348
}

0 commit comments

Comments
 (0)