Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[DoctrineBridge][TwigBridge] Add PHPDoc to attributes #51987

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/Symfony/Bridge/Doctrine/Attribute/MapEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,19 @@
#[\Attribute(\Attribute::TARGET_PARAMETER)]
class MapEntity extends ValueResolver
{
/**
* @param class-string|null $class The entity class
* @param string|null $objectManager Specify the object manager used to retrieve the entity
* @param string|null $expr An expression to fetch the entity using the {@see https://symfony.com/doc/current/components/expression_language.html ExpressionLanguage} syntax.
* Any request attribute are available as a variable, and your entity repository in the 'repository' variable.
* @param array<string, string>|null $mapping Configures the properties and values to use with the findOneBy() method
* The key is the route placeholder name and the value is the Doctrine property name
* @param string[]|null $exclude Configures the properties that should be used in the findOneBy() method by excluding
* one or more properties so that not all are used
* @param bool|null $stripNull Whether to prevent null values from being used as parameters in the query (defaults to false)
* @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
* @param bool|null $evictCache If true, forces Doctrine to always fetch the entity from the database instead of cache (defaults to false)
*/
public function __construct(
public ?string $class = null,
public ?string $objectManager = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,13 @@ class UniqueEntity extends Constraint
public bool|array|string $ignoreNull = true;

/**
* @param array|string $fields The combination of fields that must contain unique values or a set of options
* @param bool|array|string $ignoreNull The combination of fields that ignore null values
* @param array|string $fields The combination of fields that must contain unique values or a set of options
* @param bool|string[]|string $ignoreNull The combination of fields that ignore null values
* @param string|null $em The entity manager used to query for uniqueness instead of the manager of this class
* @param string|null $entityClass The entity class to enforce uniqueness on instead of the current class
* @param string|null $repositoryMethod The repository method to check uniqueness instead of findBy. The method will receive as its argument
* a fieldName => value associative array according to the fields option configuration
* @param string|null $errorPath Bind the constraint violation to this field instead of the first one in the fields option configuration
*/
public function __construct(
array|string $fields,
Expand Down
19 changes: 8 additions & 11 deletions src/Symfony/Bridge/Twig/Attribute/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,20 @@

namespace Symfony\Bridge\Twig\Attribute;

/**
* Define the template to render in the controller.
*/
#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::TARGET_FUNCTION)]
class Template
{
/**
* @param string $template The name of the template to render
* @param string[]|null $vars The controller method arguments to pass to the template
* @param bool $stream Enables streaming the template
*/
public function __construct(
/**
* The name of the template to render.
*/
public string $template,

/**
* The controller method arguments to pass to the template.
*/
public ?array $vars = null,

/**
* Enables streaming the template.
*/
public bool $stream = false,
) {
}
Expand Down