8000 Merge branch '6.1' into 6.2 · symfony/symfony@f4361fb · GitHub
[go: up one dir, main page]

Skip to content

Commit f4361fb

Browse files
committed
Merge branch '6.1' into 6.2
* 6.1: [Serializer] Added missing __call to TraceableNormalizer and TraceableSerializer update docblock to not expose the internal class [FrameworkBundle][TwigBundle] Fix registering html-sanitizer services [DependencyInjection] remove static cache from `ServiceSubscriberTrait`
2 parents a10071b + 1212d44 commit f4361fb

File tree

8 files changed

+24
-14
lines changed

8 files changed

+24
-14
lines changed

.github/expected-missing-return-types.diff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ index d68ae4c8b3..8e980a9e70 100644
1414
* @return TestContainer
1515
*/
1616
- protected static function getContainer(): ContainerInterface
17-
+ protected static function getContainer(): TestContainer
17+
+ protected static function getContainer(): Container
1818
{
1919
if (!static::$booted) {
2020
diff --git a/src/Symfony/Component/BrowserKit/AbstractBrowser.php b/src/Symfony/Component/BrowserKit/AbstractBrowser.php

src/Symfony/Bundle/FrameworkBundle/Resources/config/html_sanitizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
->set('html_sanitizer.sanitizer.default', HtmlSanitizer::class)
2424
->args([service('html_sanitizer.config.default')])
25-
->tag('html_sanitizer', ['name' => 'default'])
25+
->tag('html_sanitizer', ['sanitizer' => 'default'])
2626

2727
->alias('html_sanitizer', 'html_sanitizer.sanitizer.default')
2828
->alias(HtmlSanitizerInterface::class, 'html_sanitizer')

src/Symfony/Bundle/FrameworkBundle/Test/KernelTestCase.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Bundle\FrameworkBundle\Test;
1313

1414
use PHPUnit\Framework\TestCase;
15+
use Symfony\Component\DependencyInjection\Container;
1516
use Symfony\Component\DependencyInjection\ContainerInterface;
1617
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
1718
use Symfony\Component\HttpKernel\KernelInterface;
@@ -83,7 +84,7 @@ protected static function bootKernel(array $options = []): KernelInterface
8384
*
8485
* Using this method is the best way to get a container from your test code.
8586
*
86-
* @return TestContainer
87+
* @return Container
8788
*/
8889
protected static function getContainer(): ContainerInterface
8990
{

src/Symfony/Bundle/TwigBundle/DependencyInjection/Compiler/ExtensionPass.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ public function process(ContainerBuilder $container)
6969
$container->getDefinition('twig.extension.routing')->addTag('twig.extension');
7070
}
7171

72+
if ($container->has('html_sanitizer')) {
73+
$container->getDefinition('twig.extension.htmlsanitizer')->addTag('twig.extension');
74+
}
75+
7276
if ($container->has('fragment.handler')) {
7377
$container->getDefinition('twig.extension.httpkernel')->addTag('twig.extension');
7478
$container->getDefinition('twig.runtime.httpkernel')->addTag('twig.runtime');

src/Symfony/Bundle/TwigBundle/DependencyInjection/TwigExtension.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
use Symfony\Component\DependencyInjection\Reference;
2020
use Symfony\Component\Form\AbstractRendererEngine;
2121
use Symfony\Component\Form\Form;
22-
use Symfony\Component\HtmlSanitizer\HtmlSanitizerInterface;
2322
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
2423
use Symfony\Component\Mailer\Mailer;
2524
use Symfony\Component\Translation\Translator;
@@ -55,10 +54,6 @@ public function load(array $configs, ContainerBuilder $container)
5554
$loader->load('console.php');
5655
}
5756

58-
if (!$container::willBeAvailable('symfony/html-sanitizer', HtmlSanitizerInterface::class, ['symfony/twig-bundle'])) {
59-
$container->removeDefinition('twig.extension.htmlsanitizer');
60-
}
61-
6257
if ($container::willBeAvailable('symfony/mailer', Mailer::class, ['symfony/twig-bundle'])) {
6358
$loader->load('mailer.php');
6459
}

src/Symfony/Component/Serializer/Debug/TraceableNormalizer.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,12 @@ public function hasCacheableSupportsMethod(): bool
150150
{
151151
return $this->normalizer instanceof CacheableSupportsMethodInterface && $this->normalizer->hasCacheableSupportsMethod();
152152
}
153+
154+
/**
155+
* Proxies all method calls to the original normalizer.
156+
*/
157+
public function __call(string $method, array $arguments): mixed
158+
{
159+
return $this->normalizer->{$method}(...$arguments);
160+
}
153161
}

src/Symfony/Component/Serializer/Debug/TraceableSerializer.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,4 +165,12 @@ public function supportsDecoding(string $format, array $context = []): bool
165165
{
166166
return $this->serializer->supportsDecoding($format, $context);
167167
}
168+
169+
/**
170+
* Proxies all method calls to the original serializer.
171+
*/
172+
public function __call(string $method, array $arguments): mixed
173+
{
174+
return $this->serializer->{$method}(...$arguments);
175+
}
168176
}

src/Symfony/Contracts/Service/ServiceSubscriberTrait.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@ trait ServiceSubscriberTrait
3131
*/
3232
public static function getSubscribedServices(): array
3333
{
34-
static $services;
35-
36-
if (null !== $services) {
37-
return $services;
38-
}
39-
4034
$services = method_exists(get_parent_class(self::class) ?: '', __FUNCTION__) ? parent::getSubscribedServices() : [];
4135

4236
foreach ((new \ReflectionClass(self::class))->getMethods() as $method) {

0 commit comments

Comments
 (0)
0