Skip to content

Commit 38191d6

Browse files
Merge branch '6.3' into 6.4
* 6.3: (27 commits) [Filesystem] Follow symlinks when dumping files [Security] Add clock dependency to OidcTokenHandler [DependencyInjection] Escape `%` from parameter-like default values [SecurityBundle] add missing xsd definition for OIDC [FrameworkBundle] remove support for preloading ESM modules using headers Fix tests [SecurityBundle] Fix configuring OIDC user info token handler client [Notifier] Fix ContactEveryoneOptions CS fix [FrameworkBundle][PhpUnitBridge] Configure doctrine/deprecations as expected [HttpKernel] Fix default value ignored with pinned resolvers Fix unable to use asset mapper with CSP Fix Typos Ignore definitions bearing the `container.excluded` tag Bump Symfony version to 6.3.0 Update VERSION for 6.3.0-RC2 Update CHANGELOG for 6.3.0-RC2 Bump Symfony version to 6.2.12 Update VERSION for 6.2.11 Update CHANGELOG for 6.2.11 ...
2 parents 82fc459 + c78fe5c commit 38191d6

File tree

10 files changed

+40
-15
lines changed

10 files changed

+40
-15
lines changed

Console/Descriptor/JsonDescriptor.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ protected function describeContainerServices(ContainerBuilder $container, array
106106
if ($service instanceof Alias) {
107107
$data['aliases'][$serviceId] = $this->getContainerAliasData($service);
108108
} elseif ($service instanceof Definition) {
109+
if ($service->hasTag('container.excluded')) {
110+
continue;
111+
}
109112
$data['definitions'][$serviceId] = $this->getContainerDefinitionData($service, $omitTags, $showArguments, $container, $serviceId);
110113
} else {
111114
$data['services'][$serviceId] = $service::class;

Console/Descriptor/MarkdownDescriptor.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ protected function describeContainerServices(ContainerBuilder $container, array
162162
if ($service instanceof Alias) {
163163
$services['aliases'][$serviceId] = $service;
164164
} elseif ($service instanceof Definition) {
165+
if ($service->hasTag('container.excluded')) {
166+
continue;
167+
}
165168
$services['definitions'][$serviceId] = $service;
166169
} else {
167170
$services['services'][$serviceId] = $service;

Console/Descriptor/TextDescriptor.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,10 @@ protected function describeContainerServices(ContainerBuilder $container, array
198198
}
199199

200200
if ($definition instanceof Definition) {
201+
if ($definition->hasTag('container.excluded')) {
202+
unset($serviceIds[$key]);
203+
continue;
204+
}
201205
if ($showTag) {
202206
$tags = $definition->getTag($showTag);
203207
foreach ($tags as $tag) {

Console/Descriptor/XmlDescriptor.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,10 @@ private function getContainerServicesDocument(ContainerBuilder $container, strin
293293
continue;
294294
}
295295

296+
if ($service instanceof Definition && $service->hasTag('container.excluded')) {
297+
continue;
298+
}
299+
296300
$serviceXML = $this->getContainerServiceDocument($service, $serviceId, null, $showArguments);
297301
$containerXML->appendChild($containerXML->ownerDocument->importNode($serviceXML->childNodes->item(0), true));
298302
}

Controller/AbstractController.php

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Psr\Container\ContainerInterface;
1515
use Psr\Link\EvolvableLinkInterface;
1616
use Psr\Link\LinkInterface;
17-
use Symfony\Component\AssetMapper\ImportMap\ImportMapManager;
1817
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
1918
use Symfony\Component\DependencyInjection\ParameterBag\ContainerBagInterface;
2019
use Symfony\Component\Form\Extension\Core\Type\FormType;
@@ -97,7 +96,6 @@ public static function getSubscribedServices(): array
9796
'security.csrf.token_manager' => '?'.CsrfTokenManagerInterface::class,
9897
'parameter_bag' => '?'.ContainerBagInterface::class,
9998
'web_link.http_header_serializer' => '?'.HttpHeaderSerializer::class,
100-
'asset_mapper.importmap.manager' => '?'.ImportMapManager::class,
10199
];
102100
}
103101

@@ -412,7 +410,7 @@ protected function addLink(Request $request, LinkInterface $link): void
412410
/**
413411
* @param LinkInterface[] $links
414412
*/
415-
protected function sendEarlyHints(iterable $links = [], Response $response = null, bool $preloadJavaScriptModules = false): Response
413+
protected function sendEarlyHints(iterable $links = [], Response $response = null): Response
416414
{
417415
if (!$this->container->has('web_link.http_header_serializer')) {
418416
throw new \LogicException('You cannot use the "sendEarlyHints" method if the WebLink component is not available. Try running "composer require symfony/web-link".');
@@ -421,17 +419,6 @@ protected function sendEarlyHints(iterable $links = [], Response $response = nul
421419
$response ??= new Response();
422420

423421
$populatedLinks = [];
424-
425-
if ($preloadJavaScriptModules) {
426-
if (!$this->container->has('asset_mapper.importmap.manager')) {
427-
throw new \LogicException('You cannot use the JavaScript modules method if the AssetMapper component is not available. Try running "composer require symfony/asset-mapper".');
428-
}
429-
430-
foreach ($this->container->get('asset_mapper.importmap.manager')->getModulesToPreload() as $url) {
431-
$populatedLinks[] = new Link('modulepreload', $url);
432-
}
433-
}
434-
435422
foreach ($links as $link) {
436423
if ($link instanceof EvolvableLinkInterface && !$link->getRels()) {
437424
$link = $link->withRel('preload');

FrameworkBundle.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ class FrameworkBundle extends Bundle
9595
*/
9696
public function boot()
9797
{
98+
$_ENV['DOCTRINE_DEPRECATIONS'] = $_SERVER['DOCTRINE_DEPRECATIONS'] ??= 'trigger';
99+
98100
$handler = ErrorHandler::register(null, false);
99101
$this->container->get('debug.error_handler_configurator')->configure($handler);
100102

Tests/Controller/AbstractControllerTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ public function testSubscribedServices()
7474
'security.token_storage' => '?Symfony\\Component\\Security\\Core\\Authentication\\Token\\Storage\\TokenStorageInterface',
7575
'security.csrf.token_manager' => '?Symfony\\Component\\Security\\Csrf\\CsrfTokenManagerInterface',
7676
'web_link.http_header_serializer' => '?Symfony\\Component\\WebLink\\HttpHeaderSerializer',
77-
'asset_mapper.importmap.manager' => '?Symfony\\Component\\AssetMapper\\ImportMap\\ImportMapManager',
7877
];
7978

8079
$this->assertEquals($expectedServices, $subscribed, 'Subscribed core services in AbstractController have changed');

Tests/Fixtures/ContainerExcluded.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
namespace Symfony\Bundle\FrameworkBundle\Tests\Fixtures;
4+
5+
class ContainerExcluded
6+
{
7+
}

Tests/Functional/ContainerDebugCommandTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Symfony\Bundle\FrameworkBundle\Console\Application;
1515
use Symfony\Bundle\FrameworkBundle\Tests\Fixtures\BackslashClass;
16+
use Symfony\Bundle\FrameworkBundle\Tests\Fixtures\ContainerExcluded;
1617
use Symfony\Component\Console\Tester\ApplicationTester;
1718
use Symfony\Component\Console\Tester\CommandCompletionTester;
1819
use Symfony\Component\HttpKernel\HttpKernelInterface;
@@ -99,6 +100,19 @@ public function testDeprecatedServiceAndAlias()
99100
$this->assertStringContainsString('[WARNING] The "deprecated_alias" alias is deprecated since foo/bar 1.9 and will be removed in 2.0', $tester->getDisplay());
100101
}
101102

103+
public function testExcludedService()
104+
{
105+
static::bootKernel(['test_case' => 'ContainerDebug', 'root_config' => 'config.yml']);
106+
107+
$application = new Application(static::$kernel);
108+
$application->setAutoExit(false);
109+
110+
$tester = new ApplicationTester($application);
111+
112+
$tester->run(['command' => 'debug:container']);
113+
$this->assertStringNotContainsString(ContainerExcluded::class, $tester->getDisplay());
114+
}
115+
102116
/**
103117
* @dataProvider provideIgnoreBackslashWhenFindingService
104118
*/

Tests/Functional/app/ContainerDebug/config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,5 @@ services:
3333
- '%env(REAL)%'
3434
- '%env(int:key:2:json:JSON)%'
3535
- '%env(float:key:2:json:JSON)%'
36+
Symfony\Bundle\FrameworkBundle\Tests\Fixtures\ContainerExcluded:
37+
tags: ['container.excluded']

0 commit comments

Comments
 (0)