Skip to content

Commit b45fc93

Browse files
minor #51987 [DoctrineBridge][TwigBridge] Add PHPDoc to attributes (squrious)
This PR was squashed before being merged into the 7.1 branch. Discussion ---------- [DoctrineBridge][TwigBridge] Add PHPDoc to attributes | Q | A | ------------- | --- | Branch? | 7.1 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | Part of #51920 | License | MIT Add PHPDoc to attributes in `Symfony\Bridge\Doctrine` and `Symfony\Bridge\Twig`. Commits ------- d62ebc7615 [DoctrineBridge][TwigBridge] Add PHPDoc to attributes
2 parents 646367a + 8e21741 commit b45fc93

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

Attribute/MapEntity.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,19 @@
2020
#[\Attribute(\Attribute::TARGET_PARAMETER)]
2121
class MapEntity extends ValueResolver
2222
{
23+
/**
24+
* @param class-string|null $class The entity class
25+
* @param string|null $objectManager Specify the object manager used to retrieve the entity
26+
* @param string|null $expr An expression to fetch the entity using the {@see https://symfony.com/doc/current/components/expression_language.html ExpressionLanguage} syntax.
27+
* Any request attribute are available as a variable, and your entity repository in the 'repository' variable.
28+
* @param array<string, string>|null $mapping Configures the properties and values to use with the findOneBy() method
29+
* The key is the route placeholder name and the value is the Doctrine property name
30+
* @param string[]|null $exclude Configures the properties that should be used in the findOneBy() method by excluding
31+
* one or more properties so that not all are used
32+
* @param bool|null $stripNull Whether to prevent null values from being used as parameters in the query (defaults to false)
33+
* @param string[]|string|null $id If an id option is configured and matches a route parameter, then the resolver will find by the primary key
34+
* @param bool|null $evictCache If true, forces Doctrine to always fetch the entity from the database instead of cache (defaults to false)
35+
*/
2336
public function __construct(
2437
public ?string $class = null,
2538
public ?string $objectManager = null,

Validator/Constraints/UniqueEntity.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,13 @@ class UniqueEntity extends Constraint
3737
public bool|array|string $ignoreNull = true;
3838

3939
/**
40-
* @param array|string $fields The combination of fields that must contain unique values or a set of options
41-
* @param bool|array|string $ignoreNull The combination of fields that ignore null values
40+
* @param array|string $fields The combination of fields that must contain unique values or a set of options
41+
* @param bool|string[]|string $ignoreNull The combination of fields that ignore null values
42+
* @param string|null $em The entity manager used to query for uniqueness instead of the manager of this class
43+
* @param string|null $entityClass The entity class to enforce uniqueness on instead of the current class
44+
* @param string|null $repositoryMethod The repository method to check uniqueness instead of findBy. The method will receive as its argument
45+
* a fieldName => value associative array according to the fields option configuration
46+
* @param string|null $errorPath Bind the constraint violation to this field instead of the first one in the fields option configuration
4247
*/
4348
public function __construct(
4449
array|string $fields,

0 commit comments

Comments
 (0)