Skip to content

Conversation

@ttk
Copy link
Contributor

@ttk ttk commented Nov 29, 2025

The attribute syntax is supported in PHPUnit v10, v11, and v12. It should be encouraged in Symfony 8.x, and maybe backport to Symfony 7.x?

@carsonbot carsonbot changed the title Replace PHPDoc dataProvider with attribute syntax Replace PHPDoc dataProvider with attribute syntax Nov 29, 2025
/**
* @dataProvider urlProvider
*/
#[DataProvider('urlProvider')]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please make the data provider itself static, thanks

/**
* @dataProvider urlProvider
*/
#[DataProvider('urlProvider')]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

* @dataProvider provideInvalidConstraints

Could also be updated ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alamirault shall we create a DOCtor rule for using phpunit attributes and search and report the most common ones?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We did this update while merging. Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alamirault shall we create a DOCtor rule for using phpunit attributes and search and report the most common ones?

Not yet, not enough occurrence

@javiereguiluz javiereguiluz added this to the 7.3 milestone Dec 1, 2025
@javiereguiluz javiereguiluz changed the base branch from 8.0 to 7.3 December 1, 2025 14:45
@javiereguiluz javiereguiluz requested a review from xabbuh as a code owner December 1, 2025 14:45
@javiereguiluz javiereguiluz merged commit c4c2cf1 into symfony:7.3 Dec 1, 2025
2 of 3 checks passed
@javiereguiluz
Copy link
Member

I like this! Thanks Tom! We merged this in 7.3 and all the upper branches.

@ttk ttk deleted the patch-1 branch December 1, 2025 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants