Skip to content

Commit 979cd54

Browse files
bug #46178 [DependencyInjection] Properly declare #[When] as allowed on functions (nicolas-grekas)
This PR was merged into the 5.4 branch. Discussion ---------- [DependencyInjection] Properly declare #[When] as allowed on functions | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Caught by the CI on PHP 8.2 Not sure why it didn't fail before, but this was missing for sure. Commits ------- a8fe12b [DependencyInjection] Properly declare #[When] as allowed on functions
2 parents 337426c + a8fe12b commit 979cd54

File tree

1 file changed

+1
-1
lines changed
  • src/Symfony/Component/DependencyInjection/Attribute

1 file changed

+1
-1
lines changed

src/Symfony/Component/DependencyInjection/Attribute/When.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @author Nicolas Grekas <p@tchwork.com>
1818
*/
19-
#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)]
19+
#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::TARGET_METHOD | \Attribute::TARGET_FUNCTION | \Attribute::IS_REPEATABLE)]
2020
class When
2121
{
2222
public function __construct(

0 commit comments

Comments
 (0)