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
Fixed VersionParser being unable to parse its own MultiConstraint format #151
Conversation
The parseable string does not support arbitrary nesting of MultiConstraint anyway (that would require braces in the constraint syntax). To me, ignoring the |
Yeah this is definitely not the right fix IMO. The string is simply for human consumption. The way to do it IMO is to do a |
Background: For a customer project I needed Satis but |
Well, your approach won't work for that. Ignoring the |
Yeah, I agree. In my case it works because they are not nested ;) But I guess we could actually introduce support for nested |
Should be doable yes, but then you have to support |
and if you have more complex constraints, you might try to compact them as a way to get a simpler MultiConstraint (if your constraints don't involve dev branches, this should give you a constraint that does not involve unsupported nesting) |
Sure, I mean I solved my problem already by stripping them because that's enough for what is logically possible in my case. I just thought I'd bring this to the table here and see if we find a general solution. At least we've discussed about it in public now and others can find it too. But I agree that it's an edge case and not worth the hassle. Unless anybody wants to give it a go but then also make sure you consider the notes by @Seldaek in #151 (comment). |
The
VersionParser
currently cannot handle the output of(string) $multiConstraint
.In my case, I had to merge multiple constraints and pass them on in a string representation. When you do that, the
MultiConstraint
will return something like this:[>= 2.5.9.0-dev < 2.6.0.0-dev]
. But if you pass this toVersionParser::parseConstraints()
you'll end up getting likeUnexpectedValueException: Could not parse version constraint [>= 2.5.9.0-dev: Invalid version string "[>= 2.5.9.0-dev"
.It's pretty weird that the
VersionParser
cannot handle a format that was created by a class coming from the very same library - so I consider this a bug :)Not sure this is the right fix but tests are still green, so at least tit doesn't break any current logic (and it also fixes my issue).