Skip to content

Commit e1ca70c

Browse files
[FrameworkBundle][RemoteEvent][Routing][Scheduler] Add PHPDoc to attributes properties
1 parent 6c3d377 commit e1ca70c

File tree

6 files changed

+136
-3
lines changed

6 files changed

+136
-3
lines changed

src/Symfony/Bundle/FrameworkBundle/Routing/Attribute/AsRoutingConditionService.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@
4141
#[\Attribute(\Attribute::TARGET_CLASS)]
4242
class AsRoutingConditionService extends AutoconfigureTag
4343
{
44+
/**
45+
* @param string|null $alias The alias of the service to use it in routing condition expressions
46+
* @param int $priority The priority of the service when gathered in a service iterator or locator
47+
*/
4448
public function __construct(
4549
string $alias = null,
4650
int $priority = 0,

src/Symfony/Component/RemoteEvent/Attribute/AsRemoteEventConsumer.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
class AsRemoteEventConsumer
1919
{
2020
public function __construct(
21+
/**
22+
* The name of the remote event consumer, used to identify it when defining remote events.
23+
*/
2124
public string $name,
2225
) {
2326
}

src/Symfony/Component/Routing/Attribute/Route.php

Lines changed: 52 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,74 @@ class Route
3030
private array $schemes;
3131

3232
/**
33-
* @param array<string|\Stringable> $requirements
34-
* @param string[]|string $methods
35-
* @param string[]|string $schemes
33+
* @param string|array<string,string>|null $path The route path (i.e. "/user/login")
34+
* @param string|string[] $methods The list of HTTP methods allowed by this route
35+
* @param string|string[] $schemes The list of schemes allowed by this route (i.e. "https")
36+
* @param string|null $locale The locale accepted by the route
37+
* @param string|null $format The format returned by the route (i.e. "json", "xml")
38+
* @param bool|null $utf8 Whether the route accepts UTF-8 in its parameters
39+
* @param bool|null $stateless Whether the route is defined as stateless or stateful (@see https://symfony.com/doc/current/routing.html#stateless-routes)
3640
*/
3741
public function __construct(
3842
string|array $path = null,
43+
44+
/**
45+
* The route name (i.e. "app_user_login").
46+
*/
3947
private ?string $name = null,
48+
49+
/**
50+
* Requirements for the route attributes.
51+
*
52+
* @see https://symfony.com/doc/current/routing.html#parameters-validation
53+
*
54+
* @var array<string|\Stringable>
55+
*/
4056
private array $requirements = [],
57+
58+
/**
59+
* Other route configuration like its prefix (i.e. ['prefix' => '/api']).
60+
*
61+
* @var array<string, mixed>
62+
*/
4163
private array $options = [],
64+
65+
/**
66+
* The default values for the route attributes and
67+
* query parameters.
68+
*
69+
* @var array<string, mixed>
70+
*/
4271
private array $defaults = [],
72+
73+
/**
74+
* A host for which the route will be matched.
75+
*/
4376
private ?string $host = null,
4477
array|string $methods = [],
4578
array|string $schemes = [],
79+
80+
/**
81+
* An expression that must evaluate to true for the route
82+
* to be matched.
83+
*
84+
* @see https://symfony.com/doc/current/routing.html#matching-expressions
85+
*/
4686
private ?string $condition = null,
87+
88+
/**
89+
* The evaluation priority of the route if multiple are
90+
* defined with the same path.
91+
*/
4792
private ?int $priority = null,
4893
string $locale = null,
4994
string $format = null,
5095
bool $utf8 = null,
5196
bool $stateless = null,
97+
98+
/**
99+
* The env in which the route is defined (i.e. "dev", "test", "prod").
100+
*/
52101
private ?string $env = null
53102
) {
54103
if (\is_array($path)) {

src/Symfony/Component/Scheduler/Attribute/AsCronTask.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,47 @@
2020
class AsCronTask
2121
{
2222
public function __construct(
23+
/**
24+
* The cron expression to define the task schedule (i.e. "5 * * * *").
25+
*/
2326
public readonly string $expression,
27+
28+
/**
29+
* The timezone used with the cron expression.
30+
*/
2431
public readonly ?string $timezone = null,
32+
33+
/**
34+
* The cron jitter, in seconds. For example, if set to 60, the cron
35+
* will randomly wait for a number of seconds between 0 and 60 before
36+
* executing. This allows to avoid load spikes that can happen when many tasks
37+
* run at the same time.
38+
*/
2539
public readonly ?int $jitter = null,
40+
41+
/**
42+
* The arguments to pass to the cron task.
43+
*
44+
* @var array<array-key, mixed>|string|null
45+
*/
2646
public readonly array|string|null $arguments = null,
47+
48+
/**
49+
* The name of the schedule responsible for triggering the task.
50+
*/
2751
public readonly string $schedule = 'default',
52+
53+
/**
54+
* The method to run as the task when the attribute target is a class.
55+
*/
2856
public readonly ?string $method = null,
57+
58+
/**
59+
* One or many transports through which the message scheduling
60+
* the task will go.
61+
*
62+
* @var string[]|string|null
63+
*/
2964
public readonly array|string|null $transports = null,
3065
) {
3166
}

src/Symfony/Component/Scheduler/Attribute/AsPeriodicTask.php

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,52 @@
2020
class AsPeriodicTask
2121
{
2222
public function __construct(
23+
/**
24+
* A string or an integer representing the frequency of the task (i.e. "every hour").
25+
*/
2326
public readonly string|int $frequency,
27+
28+
/**
29+
* A string representing the start time of the periodic task (i.e. "08:00:00").
30+
*/
2431
public readonly ?string $from = null,
32+
33+
/**
34+
* A string representing the end time of the periodic task (i.e. "20:00:00").
35+
*/
2536
public readonly ?string $until = null,
37+
38+
/**
39+
* The cron jitter, in seconds. For example, if set to 60, the cron
40+
* will randomly wait for a number of seconds between 0 and 60 before
41+
* executing. This allows to avoid load spikes that can happen when many tasks
42+
* run at the same time.
43+
*/
2644
public readonly ?int $jitter = null,
45+
46+
/**
47+
* The arguments to pass to the cron task.
48+
*
49+
* @var array<array-key, mixed>|string|null
50+
*/
2751
public readonly array|string|null $arguments = null,
52+
53+
/**
54+
* The name of the schedule responsible for triggering the task.
55+
*/
2856
public readonly string $schedule = 'default',
57+
58+
/**
59+
* The method to run as the task when the attribute target is a class.
60+
*/
2961
public readonly ?string $method = null,
62+
63+
/**
64+
* One or many transports through which the message scheduling
65+
* the task will go.
66+
*
67+
* @var string[]|string|null
68+
*/
3069
public readonly array|string|null $transports = null,
3170
) {
3271
}

src/Symfony/Component/Scheduler/Attribute/AsSchedule.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
class AsSchedule
2121
{
2222
public function __construct(
23+
/**
24+
* The name of the schedule that will be used when creating tasks.
25+
*/
2326
public string $name = 'default',
2427
) {
2528
}

0 commit comments

Comments
 (0)