Skip to content

Commit 0f6b87c

Browse files
committed
Merge branch '6.1' into 6.2
* 6.1: [Yaml] Minor: Update Inline parse phpdoc [DependencyInjection] Fix dumping inlined withers [HttpClient] Move Http clients data collecting at a late level [FrameworkBundle] restore call to addGlobalIgnoredName Allow EmailValidator 4 Fix detecting mapping with one line annotations
2 parents f05cc8d + b1c19bc commit 0f6b87c

File tree

17 files changed

+90
-24
lines changed

17 files changed

+90
-24
lines changed

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
@@ -276,6 +276,7 @@ public function testUnrecognizedCacheDriverException()
276276
public function providerBundles()
277277
{
278278
yield ['AnnotationsBundle', 'annotation', '/Entity'];
279+
yield ['AnnotationsOneLineBundle', 'annotation', '/Entity'];
279280
yield ['FullEmbeddableAnnotationsBundle', 'annotation', '/Entity'];
280281
yield ['AttributesBundle', 'attribute', '/Entity'];
281282
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
"league/html-to-markdown": "^5.0",
2727
"phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0",
2828
"symfony/asset": "^5.4|^6.0",

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

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

16361636
$loader->load('annotations.php');
16371637

1638+
// registerUniqueLoader exists since doctrine/annotations v1.6
16381639
if (!method_exists(AnnotationRegistry::class, 'registerUniqueLoader')) {
1640+
// registerLoader exists only in doctrine/annotations v1
16391641
if (method_exists(AnnotationRegistry::class, 'registerLoader')) {
16401642
$container->getDefinition('annotations.dummy_registry')
16411643
->setMethodCalls([['registerLoader', ['class_exists']]]);
16421644
} else {
1645+
// remove the dummy registry when doctrine/annotations v2 is used
16431646
$container->removeDefinition('annotations.dummy_registry');
16441647
}
16451648
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
->set('annotations.reader', AnnotationReader::class)
2626
->call('addGlobalIgnoredName', [
2727
'required',
28-
service('annotations.dummy_registry')->ignoreOnInvalid(), // dummy arg to register class_exists as annotation loader only when required
28+
service('annotations.dummy_registry')->nullOnInvalid(), // dummy arg to register class_exists as annotation loader only when required
2929
])
3030

3131
->set('annotations.dummy_registry', AnnotationRegistry::class)

src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ private function addServiceMethodCalls(Definition $definition, string $variableN
734734
$witherAssignation = '';
735735

736736
if ($call[2] ?? false) {
737-
if (null !== $sharedNonLazyId && $lastWitherIndex === $k) {
737+
if (null !== $sharedNonLazyId && $lastWitherIndex === $k && 'instance' === $variableName) {
738738
$witherAssignation = sprintf('$this->%s[\'%s\'] = ', $definition->isPublic() ? 'services' : 'privates', $sharedNonLazyId);
739739
}
740740
$witherAssignation .= sprintf('$%s = ', $variableName);

src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1405,7 +1405,8 @@ public function testAliasCanBeFoundInTheDumpedContainerWhenBothTheAliasAndTheSer
14051405
public function testWither()
14061406
{
14071407
$container = new ContainerBuilder();
1408-
$container->register(Foo::class);
1408+
$container->register(Foo::class)
1409+
->setAutowired(true);
14091410

14101411
$container
14111412
->register('wither', Wither::class)

src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/autowiring_classes.php

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

1414
class Foo
1515
{
16+
/**
17+
* @required
18+
* @return static
19+
*/
20+
public function cloneFoo()
21+
{
22+
return clone $this;
23+
}
1624
}
1725

1826
class Bar

0 commit comments

Comments
 (0)