Skip to content
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

Add all PHPUnit annotations to the globally ignored list #254

Merged
merged 1 commit into from Mar 28, 2019

Conversation

jrjohnson
Copy link
Sponsor Contributor

@jrjohnson jrjohnson commented Mar 6, 2019

SenseException
SenseException previously approved these changes Mar 8, 2019
Copy link
Member

@SenseException SenseException left a comment

Choose a reason for hiding this comment

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

It's okay to me, but the PHPUnit annotations are quite a few compared to the docs. I wonder if we should put them all into the list.

@jrjohnson
Copy link
Sponsor Contributor Author

I'm happy to add the rest, I didn't want to go overboard. Just let me know what the right approach is.

@alcaeus
Copy link
Member

alcaeus commented Mar 9, 2019

The reason why most of them aren’t ignored is because most of them are only relevant in test files, where the annotation parser doesn’t go very often. The code coverage annotations on the other hand are used in entities and other logic classes, so they have to be excluded.

@doctrine/doctrinecore what’s our stance here? Should we ignore all PHPUnit annotations by default or should we expect users to manually exclude them if they use the annotation parser on test classes?

@ostrolucky
Copy link
Member

It would help if @jrjohnson would tell us his use case for using annotation parser in test files

@Majkl578
Copy link
Contributor

Should we ignore all PHPUnit annotations by default or should we expect users to manually exclude them if they use the annotation parser on test classes?

I think it might fine to include them in Annotations 2.0 where unqualified annotations will no longer be supported, thus also minimized chances for conflicts.

@jrjohnson
Copy link
Sponsor Contributor Author

A test library I'm using has recently included @DisableDatabaseCache as an annotation in tests which does pretty much what it looks like. It's the first time I've seen a parseable annotation in a test myself, but I don't see anything wrong with it as a concept.

Sounds like I should go ahead an add the rest of the PHPUnit annotations, I'll update this PR with those included.

@jrjohnson
Copy link
Sponsor Contributor Author

I've added all the annotations found at https://phpunit.readthedocs.io/en/8.0/annotations.html

@jrjohnson jrjohnson changed the title Add @covers to the globally ignored list Add all PHPUnit annotations to the globally ignored list Mar 10, 2019
'codeCoverageIgnoreEnd' => true,
'codeCoverageIgnoreStart' => true,
'covers' => true,
'author' => true,
Copy link
Contributor

Choose a reason for hiding this comment

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

@author is already part of phpDoc itself (see above).

Copy link
Contributor

Choose a reason for hiding this comment

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

Technically it's fine to have duplicates so we can even keep it for completeness.

greg0ire
greg0ire previously approved these changes Mar 10, 2019
Copy link
Member

@greg0ire greg0ire left a comment

Choose a reason for hiding this comment

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

The code looks fine to me, but I would squash the 2 commits together.

ostrolucky
ostrolucky previously approved these changes Mar 10, 2019
@jrjohnson
Copy link
Sponsor Contributor Author

jrjohnson commented Mar 10, 2019

No problem @greg0ire commits are now squashed.

@Majkl578 Majkl578 self-assigned this Mar 28, 2019
@Majkl578 Majkl578 added this to the v2.0.0 milestone Mar 28, 2019
@Majkl578 Majkl578 merged commit 7e451bf into doctrine:master Mar 28, 2019
@Majkl578
Copy link
Contributor

Thank you @jrjohnson.

@jrjohnson
Copy link
Sponsor Contributor Author

🎊 Happy to help!

@jrjohnson jrjohnson deleted the add-phpunit-covers branch June 19, 2019 14:31
@alcaeus alcaeus modified the milestones: 2.0.0, 1.11.0 May 7, 2020
@alcaeus alcaeus mentioned this pull request May 8, 2020
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.

None yet

6 participants