Closed naderman closed 3 years ago
I'm not sure generating a php matcher is needed in this package. What would be a good fit for this package would be a constraint optimizer (which would reduce a MultiConstraint to as few ranges as possible. https://github.com/Roave/SecurityAdvisoriesBuilder have some code for that.
@stof it's needed for https://github.com/composer/composer/issues/8451 - I don't think this belongs anywhere else. I do agree that more optimization than what is currently implemented in the parser should be implemented as well.
@Seldaek should this be closed thanks to the referenced PRs or is there still something to do here ?
Ping @naderman. Can this be closed?
Closing as I don't think we really want to spend time implementing this, even though it's strictly speaking not done I think. What we have is not php-code generation, but it doesn't seem we really need it.
Instead of directly matching a constraint, implement functions on the constraints to generate code which verifies if a particular version number matches the constraint. In particular the multi constraint should optimize the expression by checking only the minimally necessary boundaries on a conjunctive constraint.
This is useful to generate code in composer install which later gets verified at runtime and needs to be very fast.