Skip to content

Commit 7a94c5b

Browse files
authored
Merge branch 'symfony:6.4' into features/constraint-badge
2 parents 9a8e4ee + 4813d66 commit 7a94c5b

File tree

129 files changed

+1302
-957
lines changed

Some content is hidden

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

129 files changed

+1302
-957
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@
168168
"masterminds/html5": "<2.6",
169169
"phpdocumentor/reflection-docblock": "<5.2",
170170
"phpdocumentor/type-resolver": "<1.5.1",
171-
"phpunit/phpunit": "<5.4.3"
171+
"phpunit/phpunit": "<7.5|9.1.2"
172172
},
173173
"config": {
174174
"allow-plugins": {

src/Symfony/Bridge/Doctrine/composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
"doctrine/dbal": "<2.13.1",
5656
"doctrine/lexer": "<1.1",
5757
"doctrine/orm": "<2.12",
58-
"phpunit/phpunit": "<5.4.3",
5958
"symfony/cache": "<5.4",
6059
"symfony/dependency-injection": "<6.2",
6160
"symfony/form": "<5.4.21|>=6,<6.2.7",

src/Symfony/Bridge/ProxyManager/LazyProxy/PhpDumper/ProxyDumper.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,15 @@ public function getProxyFactoryCode(Definition $definition, string $id, string $
6161

6262
return <<<EOF
6363
if (true === \$lazyLoad) {
64-
$instantiation \$container->createProxy('$proxyClass', static function () use (\$containerRef) {
65-
return \\$proxyClass::staticProxyConstructor(static function (&\$wrappedInstance, \ProxyManager\Proxy\LazyLoadingInterface \$proxy) use (\$containerRef) {
66-
\$container = \$containerRef->get();
64+
$instantiation \$container->createProxy('$proxyClass', static fn () => \\$proxyClass::staticProxyConstructor(
65+
static function (&\$wrappedInstance, \ProxyManager\Proxy\LazyLoadingInterface \$proxy) use (\$container) {
6766
\$wrappedInstance = $factoryCode;
6867
6968
\$proxy->setProxyInitializer(null);
7069
7170
return true;
72-
});
73-
});
71+
}
72+
));
7473
}
7574
7675

src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Fixtures/php/lazy_service_structure.txt

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,16 @@ class LazyServiceProjectServiceContainer extends Container
55
{%a
66
protected static function getFooService($container, $lazyLoad = true)
77
{
8-
$containerRef = $container->ref;
9-
108
if (true === $lazyLoad) {
11-
return $container->services['foo'] = $container->createProxy('stdClass_%s', static function () use ($containerRef) {
12-
return %S\stdClass_%s(static function (&$wrappedInstance, \ProxyManager\Proxy\LazyLoadingInterface $proxy) use ($containerRef) {
13-
$container = $containerRef->get();
14-
$wrappedInstance = self::getFooService($containerRef->get(), false);
9+
return $container->services['foo'] = $container->createProxy('stdClass_%s', static fn () => %S\stdClass_%s(
10+
static function (&$wrappedInstance, \ProxyManager\Proxy\LazyLoadingInterface $proxy) use ($container) {
11+
$wrappedInstance = self::getFooService($container, false);
1512

1613
$proxy->setProxyInitializer(null);
1714

1815
return true;
19-
});
20-
});
16+
}
17+
));
2118
}
2219

2320
return new \stdClass();

src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/Fixtures/proxy-factory.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,17 @@
88
public function getFooService($lazyLoad = true)
99
{
1010
$container = $this;
11-
$containerRef = \WeakReference::create($this);
1211

1312
if (true === $lazyLoad) {
14-
return $container->privates['foo'] = $container->createProxy('SunnyInterface_1eff735', static function () use ($containerRef) {
15-
return \SunnyInterface_1eff735::staticProxyConstructor(static function (&$wrappedInstance, \ProxyManager\Proxy\LazyLoadingInterface $proxy) use ($containerRef) {
16-
$container = $containerRef->get();
13+
return $container->privates['foo'] = $container->createProxy('SunnyInterface_1eff735', static fn () => \SunnyInterface_1eff735::staticProxyConstructor(
14+
static function (&$wrappedInstance, \ProxyManager\Proxy\LazyLoadingInterface $proxy) use ($container) {
1715
$wrappedInstance = $container->getFooService(false);
1816

1917
$proxy->setProxyInitializer(null);
2018

2119
return true;
22-
});
23-
});
20+
}
21+
));
2422
}
2523

2624
return new Symfony\Bridge\ProxyManager\Tests\LazyProxy\PhpDumper\DummyClass();

src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/ProxyDumperTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ public function testGetProxyFactoryCodeForInterface()
130130
public function getFooService(\$lazyLoad = true)
131131
{
132132
\$container = \$this;
133-
\$containerRef = \\WeakReference::create(\$this);
134133
135134
{$factory} return new {$class}();
136135
}

src/Symfony/Bundle/DebugBundle/Resources/views/Profiler/dump.html.twig

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
{% for dump in collector.getDumps('html') %}
1212
<div class="sf-toolbar-info-piece">
1313
<span>
14+
{% if dump.label is defined and '' != dump.label %}
15+
<span class="sf-toolbar-file-line"><strong>{{ dump.label }}</strong> in </span>
16+
{% endif %}
1417
{% if dump.file %}
1518
{% set link = dump.file|file_link(dump.line) %}
1619
{% if link %}
@@ -45,7 +48,12 @@
4548

4649
{% for dump in collector.getDumps('html') %}
4750
<div class="sf-dump sf-reset">
48-
<span class="metadata">In
51+
<span class="metadata">
52+
{% if dump.label is defined and '' != dump.label %}
53+
<strong>{{ dump.label }}</strong> in
54+
{% else %}
55+
In
56+
{% endif %}
4957
{% if dump.line %}
5058
{% set link = dump.file|file_link(dump.line) %}
5159
{% if link %}

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/UnusedTagsPass.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class UnusedTagsPass implements CompilerPassInterface
2525
'annotations.cached_reader',
2626
'assets.package',
2727
'asset_mapper.compiler',
28+
'asset_mapper.importmap.resolver',
2829
'auto_alias',
2930
'cache.pool',
3031
'cache.pool.clearer',

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -902,8 +902,8 @@ private function addAssetMapperSection(ArrayNodeDefinition $rootNode, callable $
902902
->defaultValue('%kernel.project_dir%/assets/vendor')
903903
->end()
904904
->scalarNode('provider')
905-
->info('The provider (CDN) to use', class_exists(ImportMapManager::class) ? sprintf(' (e.g.: "%s").', implode('", "', ImportMapManager::PROVIDERS)) : '.')
906-
->defaultValue('jspm')
905+
->info('The provider (CDN) to use'.(class_exists(ImportMapManager::class) ? sprintf(' (e.g.: "%s").', implode('", "', ImportMapManager::PROVIDERS)) : '.'))
906+
->defaultValue('jsdelivr.esm')
907907
->end()
908908
->end()
909909
->end()

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
use Symfony\Component\AssetMapper\AssetMapper;
3535
use Symfony\Component\AssetMapper\Compiler\AssetCompilerInterface;
3636
use Symfony\Component\AssetMapper\ImportMap\ImportMapManager;
37+
use Symfony\Component\AssetMapper\ImportMap\Resolver\PackageResolverInterface;
3738
use Symfony\Component\BrowserKit\AbstractBrowser;
3839
use Symfony\Component\Cache\Adapter\AdapterInterface;
3940
use Symfony\Component\Cache\Adapter\ArrayAdapter;
@@ -1314,14 +1315,21 @@ private function registerAssetMapperConfiguration(array $config, ContainerBuilde
13141315
->getDefinition('asset_mapper.importmap.manager')
13151316
->replaceArgument(2, $config['importmap_path'])
13161317
->replaceArgument(3, $config['vendor_dir'])
1317-
->replaceArgument(4, $config['provider'])
1318+
;
1319+
1320+
$container
1321+
->getDefinition('asset_mapper.importmap.resolver')
1322+
->replaceArgument(0, $config['provider'])
13181323
;
13191324

13201325
$container
13211326
->getDefinition('asset_mapper.importmap.renderer')
13221327
->replaceArgument(2, $config['importmap_polyfill'] ?? ImportMapManager::POLYFILL_URL)
13231328
->replaceArgument(3, $config['importmap_script_attributes'])
13241329
;
1330+
1331+
$container->registerForAutoconfiguration(PackageResolverInterface::class)
1332+
->addTag('asset_mapper.importmap.resolver');
13251333
}
13261334

13271335
/**

0 commit comments

Comments
 (0)