8000 minor #46622 [Routing] Fix $requirements PHPDoc for SCA (fancyweb) · symfony/symfony@cdd1093 · GitHub
[go: up one dir, main page]

Skip to content

Commit cdd1093

Browse files
committed
minor #46622 [Routing] Fix $requirements PHPDoc for SCA (fancyweb)
This PR was merged into the 6.1 branch. Discussion ---------- [Routing] Fix $requirements PHPDoc for SCA | Q | A | ------------- | --- | Branch? | 6.1 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - ``` Parameter $requirements of attribute class Symfony\Component\Routing\Annotation\Route constructor expects array<string>, array<string, string|Symfony\Component\Routing\Requirement\EnumRequirement> given. ``` We officially support `\Stringable` since we introduced `EnumRequirement` in 6.1. It looks like we started supporting it in 5.0 through type coercion (614e824#diff-f82bb2cf9b0e716ac5f670438837154457d6fd24f0b99b0189c6fa3deca3ce46R535). Target 6.1 or 5.4? 🤔 Commits ------- 21daba0 [Routing] Fix $requirements PHPDoc for SCA
2 parents d4924b9 + 21daba0 commit cdd1093

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

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

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

3232
/**
33-
* @param string[] $requirements
34-
* @param string[]|string $methods
35-
* @param string[]|string $schemes
33+
* @param array<string|\Stringable> $requirements
34+
* @param string[]|string $methods
35+
* @param string[]|string $schemes
3636
*/
3737
public function __construct(
3838
string|array $path = null,

src/Symfony/Component/Routing/Route.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ class Route implements \Serializable
3737
* * compiler_class: A class name able to compile this route instance (RouteCompiler by default)
3838
* * utf8: Whether UTF-8 matching is enforced ot not
3939
*
40-
* @param string $path The path pattern to match
41-
* @param array $defaults An array of default parameter values
42-
* @param array $requirements An array of requirements for parameters (regexes)
43-
* @param array $options An array of options
44-
* @param string|null $host The host pattern to match
45-
* @param string|string[] $schemes A required URI scheme or an array of restricted schemes
46-
* @param string|string[] $methods A required HTTP method or an array of restricted methods
47-
* @param string|null $condition A condition that should evaluate to true for the route to match
40+
* @param string $path The path pattern to match
41+
* @param array $defaults An array of default parameter values
42+
* @param array<string|\Stringable> $requirements An array of requirements for parameters (regexes)
43+
* @param array $options An array of options
44+
* @param string|null $host The host pattern to match
45+
* @param string|string[] $schemes A required URI scheme or an array of restricted schemes
46+
* @param string|string[] $methods A required HTTP method or an array of restricted methods
47+
* @param string|null $condition A condition that should evaluate to true for the route to match
4848
*/
4949
public function __construct(string $path, array $defaults = [], array $requirements = [], array $options = [], ?string $host = '', string|array $schemes = [], string|array $methods = [], ?string $condition = '')
5050
{

0 commit comments

Comments
 (0)
0