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

Unify handling of requirements annotation to be handled completely by phar-io/version #2622

Closed
dnaber-de opened this issue Apr 1, 2017 · 3 comments
Labels
type/backward-compatibility Something will be/is intentionally broken

Comments

@dnaber-de
Copy link
Contributor

dnaber-de commented Apr 1, 2017

Q A
PHPUnit version > 6.* (unreleased patch)
PHP version 7.*
Installation Method Composer

The changes made for #2386 introduces some »overhead« in order to maintain backward compatibility. For the next major release (probably version 7) PHPUnit\Util\Test allows some backward incompatible improvements.

Suggested updates

  • Combine both regular expressions PHPUnit\Util\Test::REGEX_REQUIRES_VERSION and PHPUnit\Util\Test::REGEX_REQUIRES_VERSION_CONSTRAINT to cover all possible version constraints
  • Combine the structure of the requirements array created by PHPUnit\Util\Test::getRequirements(): $requirements['PHP_constraint'] and $requirements['PHP']
  • Rely on phar-io/version API to handle version compliance check for every possible case

Update
Related pull request: #2623

@sebastianbergmann sebastianbergmann added the type/backward-compatibility Something will be/is intentionally broken label Apr 1, 2017
@sebastianbergmann sebastianbergmann added this to the PHPUnit 7.0 milestone Apr 1, 2017
@sebastianbergmann
Copy link
Owner

@dnaber-de Can you send a pull request that implements the proposed changes?

@dnaber-de
Copy link
Contributor Author

Yes, I'll take some time on this next week.

@dnaber-de
Copy link
Contributor Author

Sorry, it seems that I was to optimistic with my proposal.

Rely on phar-io/version API to handle version compliance check for every possible case

Right now, it can only compare constraints that contains the caret or tilde operator. Thus, there won't be much benefit in changing Tests::getRequirements() as Tests::getMissingRequirements() would still need to make a difference between constraints like >=7.0 and ^7.0.

I'll have a more detailed look into phar-io/version and maybe suggest an improvement over there. Suggest to close this ticket right now.

@sebastianbergmann sebastianbergmann removed this from the PHPUnit 7.0 milestone Jan 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/backward-compatibility Something will be/is intentionally broken
Projects
None yet
Development

No branches or pull requests

2 participants