Skip to content

Ignore pre- and postCondition PHPUnit annotations#315

Closed
rybakit wants to merge 98 commits intodoctrine:masterfrom
rybakit:patch-1
Closed

Ignore pre- and postCondition PHPUnit annotations#315
rybakit wants to merge 98 commits intodoctrine:masterfrom
rybakit:patch-1

Conversation

@rybakit
Copy link
Copy Markdown

@rybakit rybakit commented Mar 31, 2020

Majkl578 and others added 30 commits May 2, 2018 00:34
Open 2.0 - PHP 7.2, change namespace
Eliminate AnnotationRegistry, rely on autoloading only
Upgrading note for dropped AnnotationRegistry
Fixed typo in the documentation
`string` is wrong as it can also be `null` or an `array`. Merging this (and tagging a new bugfix release) would help me with doctrine/mongodb-odm#1803 :)
Change Annotation::value typehint to mixed
The second argument is supposed to be the Annotation you want to get,
the property name is already contained in $property.
Add .doctrine-project.json to root of the project.
greg0ire and others added 22 commits March 25, 2019 21:41
Use void where applicable in the tests directory
Add all PHPUnit annotations to the globally ignored list
This fixes the phpstan job of the build.
Refs #255
Make phpdoc comments accurate
Type hiearchy for property types and enums
* 1.8:
  No longer require dev versions of PHPUnit on PHP 7.4
  Ignores PHP CodeSniffer annotations.
  Adds globally ignored annotations to DocParser.
  Ignores phpcsSuppress annotation.
  Work around deprecation error on PHP 7.4
  Fix access array offset on value of type null
  Require PHP 7.4 build to pass
  Added v1.6.1 release notes
  Added v1.6.0 release notes
  Run against `nightly` and `7.4`, ignore failures there
  Using `void` type declaration where applicable in `DocLexerTest`
  Corrected docblock wording for `nextTokenIsAdjacent` (grammar issues)
  Ensuring that `-` in identifiers won't happen in annotation reading
  Skip parsing of annotations immediately followed by `T_MINUS` ("-")
  `DocLexer#nextTokenIsAdjacent()`: are there are non-captured sequences between tokens?
  Introduced a new `T_MINUS` token - used to recognize isolated "-" signs
  Convert performance tests to PHPBench
Fixed exception message when an annotation does not provide any properties
It did not seem to reflect the current situation. The latest release is
1.8.0, so that probably means:
- 1.8 is the current branch
- 1.6 and 1.7 are no longer maintained
- 1.9 is upcoming
Update branch metadata
@greg0ire
Copy link
Copy Markdown
Member

greg0ire commented Apr 1, 2020

I think you should target a lower branch: 1.8 if this is considered a bugfix, 1.9 if this is considered a new feature. Not sure which it should be.

@rybakit
Copy link
Copy Markdown
Author

rybakit commented Apr 1, 2020

In 1.9, PHPUnit annotations are defined in AnnotationReader.php, and there are only three of them. I'm not sure it makes sense to add 2 more to this file if most of them are missing anyway: https://github.com/doctrine/annotations/blob/1.9/lib/Doctrine/Common/Annotations/AnnotationReader.php#L94.

@greg0ire
Copy link
Copy Markdown
Member

greg0ire commented Apr 1, 2020

Yeah but look at #242 (comment) … it seems that commit should have been cherry-picked. @Ocramius can you maybe help with this?
b4b397a looks BC to me, could be cherry-picked IMO… so does 7ccffb7 .
As you can see, master is aliased to 2.0, meaning it should contain BC-breaks only:

"dev-master": "2.0.x-dev"

Hopefully another maintainer will chime in on this, I don't know why things have been done this way. Might be a legacy of the merge-down workflow Doctrine used to use.

@alcaeus
Copy link
Copy Markdown
Member

alcaeus commented Apr 1, 2020

In 1.x, we only ignore the code coverage annotations for PHPUnit, since the assumption is that people won't be reading annotations in their tests folder, where other PHPUnit annotations are commonly found.

As for the branch to target, master was a 2.0.x development branch that has stalled completely. Previous work has been backed up (see https://github.com/alcaeus/annotations/tree/previous-master) and will be revisited once we're ready to start work on 2.0 again. Since the previous master branch contained a number of severe BC breaks that were not covered by a compatibility layer or announced in 1.x releases, this was necessary to ensure a consistent workflow.

If you think that these exceptions should be ignored generally, I invite you to create a new pull request to the master branch. Thanks!

@alcaeus alcaeus closed this Apr 1, 2020
@rybakit rybakit deleted the patch-1 branch April 1, 2020 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.