Skip to content

Commit

Permalink
Merge branch '6.0' into 6.1
Browse files Browse the repository at this point in the history
* 6.0:
  [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
  • Loading branch information
fabpot committed Jan 10, 2023
2 parents 3a67cc0 + 5768dd5 commit f501596
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DependencyInjection/AbstractDoctrineExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,8 @@ private function detectMappingType(string $directory, ContainerBuilder $containe
break;
}
if (
preg_match('/^ \* @.*'.$quotedMappingObjectName.'\b/m', $content) ||
preg_match('/^ \* @.*Embeddable\b/m', $content)
preg_match('/^(?: \*|\/\*\*) @.*'.$quotedMappingObjectName.'\b/m', $content) ||
preg_match('/^(?: \*|\/\*\*) @.*Embeddable\b/m', $content)
) {
$type = 'annotation';
break;
Expand Down
1 change: 1 addition & 0 deletions Tests/DependencyInjection/DoctrineExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ public function testUnrecognizedCacheDriverException()
public function providerBundles()
{
yield ['AnnotationsBundle', 'annotation', '/Entity'];
yield ['AnnotationsOneLineBundle', 'annotation', '/Entity'];
yield ['FullEmbeddableAnnotationsBundle', 'annotation', '/Entity'];
yield ['AttributesBundle', 'attribute', '/Entity'];
yield ['FullEmbeddableAttributesBundle', 'attribute', '/Entity'];
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Fixtures\Bundles\AnnotationsOneLineBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class AnnotationsOneLineBundle extends Bundle
{
}
37 changes: 37 additions & 0 deletions Tests/Fixtures/Bundles/AnnotationsOneLineBundle/Entity/Person.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Fixtures\Bundles\AnnotationsOneLineBundle\Entity;

use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\Id;

/** @Entity */
class Person
{
/** @Id @Column(type="integer") */
protected $id;

/** @Column(type="string") */
public $name;

public function __construct($id, $name)
{
$this->id = $id;
$this->name = $name;
}

public function __toString(): string
{
return (string) $this->name;
}
}

0 comments on commit f501596

Please sign in to comment.