Skip to content

Commit ac438a4

Browse files
Merge branch '5.4' into 6.0
* 5.4: Revert "minor symfony#47721 [Notifier] Use local copy of stella-maris/clock when testing (nicolas-grekas)" [Yaml] Minor: Update Inline parse phpdoc [FrameworkBundle] Fix deprecation when accessing a "container.private" service from the test container [DependencyInjection] Fix dumping inlined withers [HttpClient] Move Http clients data collecting at a late level [DependencyInjection] Fix support for named arguments on non-autowired services [FrameworkBundle] restore call to addGlobalIgnoredName Allow EmailValidator 4 Fix detecting mapping with one line annotations
2 parents 9aa058a + 22b5860 commit ac438a4

File tree

29 files changed

+155
-88
lines changed

29 files changed

+155
-88
lines changed

.github/workflows/package-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
- name: Find packages
2323
id: find-packages
24-
run: echo "packages=$(php .github/get-modified-packages.php $(find src/Symfony -mindepth 2 -maxdepth 6 -type f -name composer.json -printf '%h\n' | jq -R -s -c 'split("\n")[:-1]') $(git diff --name-only origin/${{ github.base_ref }} HEAD | grep src/ | jq -R -s -c 'split("\n")[:-1]'))" >> $GITHUB_OUTPUT
24+
run: echo "packages=$(php .github/get-modified-packages.php $(find src/Symfony -mindepth 2 -type f -name composer.json -printf '%h\n' | jq -R -s -c 'split("\n")[:-1]') $(git diff --name-only origin/${{ github.base_ref }} HEAD | grep src/ | jq -R -s -c 'split("\n")[:-1]'))" >> $GITHUB_OUTPUT
2525

2626
- name: Verify meta files are correct
2727
run: |

.github/workflows/unit-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ jobs:
9393
echo SYMFONY_DEPRECATIONS_HELPER=weak >> $GITHUB_ENV
9494
cp composer.json composer.json.orig
9595
echo -e '{\n"require":{'"$(grep phpunit-bridge composer.json)"'"php":"*"},"minimum-stability":"dev"}' > composer.json
96-
php .github/build-packages.php HEAD^ $SYMFONY_VERSION $(find src/Symfony -mindepth 2 -maxdepth 6 -type f -name composer.json -printf '%h\n')
96+
php .github/build-packages.php HEAD^ $SYMFONY_VERSION $(find src/Symfony -mindepth 2 -type f -name composer.json -printf '%h\n')
9797
mv composer.json composer.json.phpunit
9898
mv composer.json.orig composer.json
9999
fi

composer.json

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -197,15 +197,6 @@
197197
{
198198
"type": "path",
199199
"url": "src/Symfony/Component/Runtime"
200-
},
201-
{
202-
"type": "path",
203-
"url": "src/Symfony/Component/Notifier/Bridge/Mercure/Tests/stella-maris-clock",
204-
"options": {
205-
"versions": {
206-
"stella-maris/clock": "0.1.x-dev"
207-
}
208-
}
209200
}
210201
],
211202
"minimum-stability": "dev"

src/Symfony/Bridge/Doctrine/DependencyInjection/AbstractDoctrineExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,8 @@ private function detectMappingType(string $directory, ContainerBuilder $containe
301301
break;
302302
}
303303
if (
304-
preg_match('/^ \* @.*'.$quotedMappingObjectName.'\b/m', $content) ||
305-
preg_match('/^ \* @.*Embeddable\b/m', $content)
304+
preg_match('/^(?: \*|\/\*\*) @.*'.$quotedMappingObjectName.'\b/m', $content) ||
305+
preg_match('/^(?: \*|\/\*\*) @.*Embeddable\b/m', $content)
306306
) {
307307
$type = 'annotation';
308308
break;

src/Symfony/Bridge/Doctrine/Tests/DependencyInjection/DoctrineExtensionTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ public function testUnrecognizedCacheDriverException()
279279
public function providerBundles()
280280
{
281281
yield ['AnnotationsBundle', 'annotation', '/Entity'];
282+
yield ['AnnotationsOneLineBundle', 'annotation', '/Entity'];
282283
yield ['FullEmbeddableAnnotationsBundle', 'annotation', '/Entity'];
283284
yield ['AttributesBundle', 'attribute', '/Entity'];
284285
yield ['FullEmbeddableAttributesBundle', 'attribute', '/Entity'];
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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 Fixtures\Bundles\AnnotationsOneLineBundle;
13+
14+
use Symfony\Component\HttpKernel\Bundle\Bundle;
15+
16+
class AnnotationsOneLineBundle extends Bundle
17+
{
18+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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 Fixtures\Bundles\AnnotationsOneLineBundle\Entity;
13+
14+
use Doctrine\ORM\Mapping\Column;
15+
use Doctrine\ORM\Mapping\Entity;
16+
use Doctrine\ORM\Mapping\Id;
17+
18+
/** @Entity */
19+
class Person
20+
{
21+
/** @Id @Column(type="integer") */
22+
protected $id;
23+
24+
/** @Column(type="string") */
25+
public $name;
26+
27+
public function __construct($id, $name)
28+
{
29+
$this->id = $id;
30+
$this->name = $name;
31+
}
32+
33+
public function __toString(): string
34+
{
35+
return (string) $this->name;
36+
}
37+
}

src/Symfony/Bridge/Twig/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
},
2323
"require-dev": {
2424
"doctrine/annotations": "^1.12|^2",
25-
"egulias/email-validator": "^2.1.10|^3",
25+
"egulias/email-validator": "^2.1.10|^3|^4",
2626
"phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0",
2727
"symfony/asset": "^5.4|^6.0",
2828
"symfony/dependency-injection": "^5.4|^6.0",

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler;
1313

14+
use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument;
1415
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
1516
use Symfony\Component\DependencyInjection\ContainerBuilder;
1617
use Symfony\Component\DependencyInjection\Reference;
@@ -38,6 +39,16 @@ public function process(ContainerBuilder $container)
3839
}
3940
}
4041

42+
foreach ($container->getAliases() as $id => $target) {
43+
while ($container->hasAlias($target = (string) $target)) {
44+
$target = $container->getAlias($target);
45+
}
46+
47+
if ($definitions[$target]->hasTag('container.private')) {
48+
$privateServices[$id] = new ServiceClosureArgument(new Reference($target));
49+
}
50+
}
51+
4152
$privateContainer->replaceArgument(0, $privateServices);
4253
}
4354
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,11 +1569,14 @@ private function registerAnnotationsConfiguration(array $config, ContainerBuilde
15691569

15701570
$loader->load('annotations.php');
15711571

1572+
// registerUniqueLoader exists since doctrine/annotations v1.6
15721573
if (!method_exists(AnnotationRegistry::class, 'registerUniqueLoader')) {
1574+
// registerLoader exists only in doctrine/annotations v1
15731575
if (method_exists(AnnotationRegistry::class, 'registerLoader')) {
15741576
$container->getDefinition('annotations.dummy_registry')
15751577
->setMethodCalls([['registerLoader', ['class_exists']]]);
15761578
} else {
1579+
// remove the dummy registry when doctrine/annotations v2 is used
15771580
$container->removeDefinition('annotations.dummy_registry');
15781581
}
15791582
}

0 commit comments

Comments
 (0)