Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4932cbe

Browse filesBrowse 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 ------- d62ebc7 [DoctrineBridge][TwigBridge] Add PHPDoc to attributes
2 parents 4086e81 + d62ebc7 commit 4932cbe
Copy full SHA for 4932cbe

File tree

3 files changed

+28
-13
lines changed
Filter options

3 files changed

+28
-13
lines changed

‎src/Symfony/Bridge/Doctrine/Attribute/MapEntity.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Attribute/MapEntity.php
+13Lines 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,

‎src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntity.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntity.php
+7-2Lines 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,

‎src/Symfony/Bridge/Twig/Attribute/Template.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/Attribute/Template.php
+8-11Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,20 @@
1111

1212
namespace Symfony\Bridge\Twig\Attribute;
1313

14+
/**
15+
* Define the template to render in the controller.
16+
*/
1417
#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::TARGET_FUNCTION)]
1518
class Template
1619
{
20+
/**
21+
* @param string $template The name of the template to render
22+
* @param string[]|null $vars The controller method arguments to pass to the template
23+
* @param bool $stream Enables streaming the template
24+
*/
1725
public function __construct(
18-
/**
19-
* The name of the template to render.
20-
*/
2126
public string $template,
22-
23-
/**
24-
* The controller method arguments to pass to the template.
25-
*/
2627
public ?array $vars = null,
27-
28-
/**
29-
* Enables streaming the template.
30-
*/
3128
public bool $stream = false,
3229
) {
3330
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.